class FirefoxAccount : RustObject<RawFxAccount>
(source)
FirefoxAccount represents the authentication state of a client.
Parameters
FirefoxAccount(config: Config, clientId: String, redirectUri: String) FirefoxAccount(rawPointer: RawFxAccount?)
FirefoxAccount represents the authentication state of a client. |
var rawPointer: RawFxAccount? |
val isConsumed: Boolean |
fun beginOAuthFlow(scopes: Array<String>, wantsKeys: Boolean): FxaResult<String>
Constructs a URL used to begin the OAuth flow for the requested scopes and keys. |
|
fun beginPairingFlow(pairingUrl: String, scopes: Array<String>): FxaResult<String> |
|
fun completeOAuthFlow(code: String, state: String): FxaResult<OAuthInfo>
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 destroy(p: RawFxAccount): Unit |
|
fun getOAuthToken(scopes: Array<String>): FxaResult<OAuthInfo>
Fetches a new access token for the desired scopes using an internally stored refresh token. |
|
fun getProfile(ignoreCache: Boolean): FxaResult<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(): FxaResult<Profile>
Convenience method to fetch the profile from a cached account by default, but fall back to retrieval from the server. |
|
fun getSyncKeys(): SyncKeys
Fetches keys for encryption/decryption of Firefox Sync data. |
|
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. |
open fun close(): Unit |
|
fun consumePointer(): T |
|
fun validPointer(): T |
fun from(config: Config, clientId: String, redirectUri: String, webChannelResponse: String): FxaResult<FirefoxAccount> |
|
fun fromJSONString(json: String): FxaResult<FirefoxAccount>
Restores the account's authentication state from a JSON string produced by FirefoxAccount.toJSONString. |