Struct tozny_auth::user::UserApi [-] [+] [src]

pub struct UserApi {
    // some fields omitted
}

Interface for sending user-level API calls to Tozny.

Methods

impl UserApi

fn new(key_id: KeyId, url: Url) -> UserApi

It is necessary to provide a realm key id to identify a realm. However the corresponding secret is not required. So this method can be called in an untrusted environment.

The URL's for the public Tozny API is: https://api.tozny.com

fn raw_call<'a>(&self, params: Vec<(&'a str, &'a str)>) -> Result<Json, QuestionError>

Low-level method for sending arbitrary user-level API calls.

fn login_challenge(&self) -> Result<LoginChallenge, QuestionError>

Use this method to initiate a login. See the documentation on LoginChallenge for some information on how to use the response.

fn push(&self, session_id: &SessionId, presence: &Presence) -> Result<(), QuestionError>

Sends a push notification to a user's mobile device asking the user to sign in to something.

fn check_session_status(&self, session_id: &SessionId) -> Result<Option<Question>, QuestionError>

Returns a signed question that may be checked via the Realm verify_login method to verify an authenticated session (if the result is Ok(Some(question)). If the result is Ok(None) that indicates that the session is "pending" - the user has not yet confirmed the session via the Tozny app.