Search Results for

    Show / Hide Table of Contents

    Class Credentials

    A class, representing the credentials used for authenticating a User.

    Inheritance
    object
    Credentials
    Namespace: Realms.Sync
    Assembly: Realm.dll
    Syntax
    public class Credentials

    Properties

    | Improve this Doc View Source

    Provider

    Gets a value indicating which Credentials.AuthProvider these Credentials are using.

    Declaration
    [Preserve]
    public Credentials.AuthProvider Provider { get; }
    Property Value
    Type Description
    Credentials.AuthProvider

    The Credentials.AuthProvider these credentials use.

    Methods

    | Improve this Doc View Source

    Anonymous(bool)

    Creates credentials representing an anonymous user.

    Declaration
    public static Credentials Anonymous(bool reuseExisting = true)
    Parameters
    Type Name Description
    bool reuseExisting

    A value indicating whether anonymous users should be reused. Passing true means that multiple calls to app.LoginAsync(Credentials.Anonymous()) will return the same anonymous user as long as that user hasn't logged out. If reuseExisting is false, every time you call LogInAsync(Credentials), a new user will be created on the server.

    Returns
    Type Description
    Credentials

    A Credentials that can be used to authenticate an anonymous user.

    See Also
    Anonymous Authentication Docs
    | Improve this Doc View Source

    ApiKey(string)

    Creates credentials representing a login using an API key generated by a client SDK.

    Declaration
    public static Credentials ApiKey(string key)
    Parameters
    Type Name Description
    string key

    The API key to use for login.

    Returns
    Type Description
    Credentials

    A Credentials that can be used to authenticate user with an API key.

    See Also
    API Key Authentication Docs
    | Improve this Doc View Source

    Apple(string)

    Creates credentials representing a login using an Apple ID access token.

    Declaration
    public static Credentials Apple(string accessToken)
    Parameters
    Type Name Description
    string accessToken

    The OAuth 2.0 access token representing the user's Apple ID.

    Returns
    Type Description
    Credentials

    A Credentials that can be used to authenticate a user via an Apple ID.

    See Also
    Apple ID Authentication Docs
    | Improve this Doc View Source

    EmailPassword(string, string)

    Creates credentials representing a login using an email and password.

    Declaration
    public static Credentials EmailPassword(string email, string password)
    Parameters
    Type Name Description
    string email

    The user's email.

    string password

    The user's password.

    Returns
    Type Description
    Credentials

    A Credentials that can be used to authenticate a user with their email and password.

    Remarks

    A user can login with email and password only after they've registered their account and verified their email. To register an email/password user via the SDK, use RegisterUserAsync(string, string). To verify an email from the SDK, use ConfirmUserAsync(string, string). The email/password provider can also be configured to automatically confirm users or to run a custom confirmation function upon user registration.

    See Also
    Email/Password Authentication Docs
    | Improve this Doc View Source

    Facebook(string)

    Creates credentials representing a login using a Facebook access token.

    Declaration
    public static Credentials Facebook(string accessToken)
    Parameters
    Type Name Description
    string accessToken

    The OAuth 2.0 access token representing the Facebook user.

    Returns
    Type Description
    Credentials

    A Credentials that can be used to authenticate a user with Facebook.

    See Also
    Facebook Authentication Docs
    | Improve this Doc View Source

    Function(object)

    Creates credentials represetning a login with Realm function.

    Declaration
    public static Credentials Function(object payload)
    Parameters
    Type Name Description
    object payload

    The payload that will be passed as an argument to the server function.

    Returns
    Type Description
    Credentials

    A Credentials that can be used to authenticate a user by invoking a server function.

    Remarks

    The payload object will be serialized and parsed when invoking the Realm function. This means that unserializable values, such as references to functions or cyclic object graphs will not work. Additionally, the names of the fields/properties must match exactly the names that your function expects.

    See Also
    Custom Function Authentication Docs
    | Improve this Doc View Source

    Google(string, GoogleCredentialType)

    Creates credentials representing a login using a Google account.

    Declaration
    public static Credentials Google(string credential, GoogleCredentialType type)
    Parameters
    Type Name Description
    string credential

    The credential representing the Google user.

    GoogleCredentialType type

    The type of the credential.

    Returns
    Type Description
    Credentials

    A Credentials that can be used to authenticate a user with Google.

    See Also
    Google Authentication Docs
    | Improve this Doc View Source

    JWT(string)

    Creates credentials representing a login using a JWT Token.

    Declaration
    public static Credentials JWT(string customToken)
    Parameters
    Type Name Description
    string customToken

    The custom JWT token representing the user.

    Returns
    Type Description
    Credentials

    A Credentials that can be used to authenticate a user with a custom JWT Token.

    See Also
    Custom JWT Authentication Docs
    | Improve this Doc View Source

    ServerApiKey(string)

    Creates credentials representing a login using an API key generated in the server UI.

    Declaration
    public static Credentials ServerApiKey(string serverApiKey)
    Parameters
    Type Name Description
    string serverApiKey

    The server API key to use for login.

    Returns
    Type Description
    Credentials

    A Credentials that can be used to authenticate user with an API key.

    See Also
    API Key Authentication Docs
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2020-2023 Realm
    Generated by DocFX