Realm.Credentials

Class for creating user credentials

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.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.custom(token)Credentials
static

Creates credentials with a custom 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.
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(token)Promise<Credentials>
static

Creates credentials with a MongoDB Realm function and user identifier.

Parameters:
  • token
    • 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(token)Credentials
static

Creates credentials based on a Google login.

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

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

Creates credentials from a server API key.

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

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

Creates credentials from a user API key.

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

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