Realm.Credentials

Class for creating user credentials

payload
provider

Gets the identity provider for the credentials.

Realm.Credentials.anonymous()Credentials
static

Creates credentials for an anonymous user. These can only be used once - using them a second time will result in a different user being logged in. If you need to get a user that has already logged in with the Anonymous credentials, use Realm.App.currentUser or Realm.App.allUsers

Returns: Credentials An instance of Credentials that can be used in Realm.App.logIn.
Realm.Credentials.apiKey(key)Credentials
static

Creates credentials from an API key.

Parameters:
  • key
    • Type: string
    • A string identifying the API key.

Returns: Credentials An instance of Credentials that can be used in Realm.App.logIn.
Realm.Credentials.apple(token)Credentials
static

Creates credentials based on an Apple login.

Parameters:
  • token
    • Type: string
    • An Apple authentication token, obtained by logging into Apple.

Returns: Credentials An instance of Credentials that can be used in Realm.App.logIn.
Realm.Credentials.emailPassword(username, password)Credentials
static

Creates credentials based on a login with an email address and a password.

Parameters:
  • username
    • Type: string
    • The username of the user.

  • password
    • Type: string
    • The user's password.

Returns: Credentials An instance of Credentials that can be used in Realm.App.logIn.
Realm.Credentials.facebook(token)Credentials
static

Creates credentials based on a Facebook login.

Parameters:
  • token
    • Type: string
    • A Facebook authentication token, obtained by logging into Facebook.

Returns: Credentials An instance of Credentials that can be used in Realm.App.logIn.
Realm.Credentials.function(payload)Promise<Credentials>
static

Creates credentials with an Atlas App Services function and user identifier.

Parameters:
  • payload
    • Type: string
    • A string identifying the user. Usually an identity token or a username.

Returns: Promise<Credentials> An instance of Credentials that can be used in Realm.App.logIn.
Realm.Credentials.google(An)Credentials
static

Creates credentials based on a Google login.

Parameters:
  • An
    • Type: object
    • object with either an authCode or idToken property.

Returns: Credentials An instance of Credentials that can be used in Realm.App.logIn.
Realm.Credentials.jwt(token)Credentials
static

Creates credentials with a JSON Web Token (JWT) provider and user identifier.

Parameters:
  • token
    • Type: string
    • A string identifying the user. Usually an identity token or a username.

Returns: Credentials An instance of Credentials that can be used in Realm.App.logIn.