class FirefoxAccount : AutoCloseable, FirefoxAccountShaped
(source)
FirefoxAccount represents the authentication state of a client.
FirefoxAccount(config: Config)
Construct a FirefoxAccount from a Config, a clientId, and a redirectUri. |
fun beginOAuthFlow(scopes: Array<String>, wantsKeys: Boolean): Deferred<String>
Constructs a URL used to begin the OAuth flow for the requested scopes and keys. |
|
fun beginPairingFlow(pairingUrl: String, scopes: Array<String>): Deferred<String> |
|
fun close(): Unit |
|
fun completeOAuthFlow(code: String, state: String): Deferred<Unit>
Authenticates the current account using the code and state parameters fetched from the redirect URL reached after completing the sign in flow triggered by beginOAuthFlow. |
|
fun getAccessToken(singleScope: String): Deferred<AccessTokenInfo>
Tries to fetch an access token for the given scope. |
|
fun getProfile(ignoreCache: Boolean): Deferred<Profile>
Fetches the profile object for the current client either from the existing cached account, or from the server (requires the client to have access to the profile scope). fun getProfile(): Deferred<Profile>
Convenience method to fetch the profile from a cached account by default, but fall back to retrieval from the server. |
|
fun getTokenServerEndpointURL(): String
Fetches the token server endpoint, for authentication using the SAML bearer flow. |
|
fun toJSONString(): String
Saves the current account's authentication state as a JSON string, for persistence in the Android KeyStore/shared preferences. The authentication state can be restored using FirefoxAccount.fromJSONString. |
fun fromJSONString(json: String): FirefoxAccount
Restores the account's authentication state from a JSON string produced by FirefoxAccount.toJSONString. |