C# Class Realms.Sync.Credentials

A class, representing the credentials used for authenticating a User.
Exibir arquivo Open project: realm/realm-dotnet Class Usage Examples

Public Methods

Method Description
Custom ( string identityProvider, string userIdentifier, object>.IDictionary userInfo ) : Credentials

Creates an instance of Credentials with a custom provider and user identifier.

Debug ( ) : Credentials

Creates an instance of Credentials to be used during development. Not enabled for Realm Object Server configured for production.

Facebook ( string facebookToken ) : Credentials

Creates Credentials based on a Facebook login.

Google ( string googleToken ) : Credentials

Creates Credentials based on a Google login.

UsernamePassword ( string username, string password, bool createUser ) : Credentials

Creates Credentials based on a login with a username and a password.

Private Methods

Method Description
AccessToken ( string accessToken, string identity, bool isAdmin = false ) : Credentials
Credentials ( ) : System
Credentials ( ) : System.Collections.Generic
ToJson ( ) : JsonObject

Method Details

Custom() public static method

Creates an instance of Credentials with a custom provider and user identifier.
public static Custom ( string identityProvider, string userIdentifier, object>.IDictionary userInfo ) : Credentials
identityProvider string Provider used to verify the credentials.
userIdentifier string String identifying the user. Usually a username of id.
userInfo object>.IDictionary Data describing the user further or null if the user does not have any extra data. The data will be serialized to JSON, so all values must be mappable to a valid JSON data type.
return Credentials

Debug() public static method

Creates an instance of Credentials to be used during development. Not enabled for Realm Object Server configured for production.
public static Debug ( ) : Credentials
return Credentials

Facebook() public static method

Creates Credentials based on a Facebook login.
public static Facebook ( string facebookToken ) : Credentials
facebookToken string A Facebook authentication token, obtained by logging into Facebook.
return Credentials

Google() public static method

Creates Credentials based on a Google login.
public static Google ( string googleToken ) : Credentials
googleToken string A Google authentication token, obtained by logging into Google.
return Credentials

UsernamePassword() public static method

Creates Credentials based on a login with a username and a password.
public static UsernamePassword ( string username, string password, bool createUser ) : Credentials
username string The username of the user.
password string The user's password.
createUser bool true if the user should be created, false otherwise. It is not possible to create a user twice when logging in, so this flag should only be set to true the first time a user logs in.
return Credentials