Class Credentials
A class, representing the credentials used for authenticating a User.
Namespace: Realms.Sync
Assembly: Realm.dll
Syntax
public class Credentials
Properties
| Edit this page View SourceProvider
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
| Edit this page View SourceAnonymous(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 |
Returns
Type | Description |
---|---|
Credentials | A Credentials that can be used to authenticate an anonymous user. |
See Also
| Edit this page View SourceApiKey(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
| Edit this page View SourceApple(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
| Edit this page View SourceEmailPassword(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 | 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
| Edit this page View SourceFacebook(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
| Edit this page View SourceFunction(object)
Creates credentials representing 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
| Edit this page View SourceGoogle(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
| Edit this page View SourceJWT(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
| Edit this page View SourceServerApiKey(string)
Creates credentials representing a login using an API key generated in the server UI.
Declaration
[Obsolete("Use Credentials.ApiKey instead.")]
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. |