io.realm.mongodb
Las credenciales representan un inicio de sesión con un proveedor de inicio de sesión determinado y MongoDB Realm las utiliza para verificar al usuario y otorgar acceso. El proveedor Provider.EMAIL_PASSWORD está habilitado por defecto. Todos los demás proveedores deben estar habilitados en MongoDB Realm para funcionar.
Tenga en cuenta que los usuarios que deseen iniciar sesión usando correo electrónico/contraseña deben registrarse primero utilizando EmailPasswordAuth.registerUser(String, String).
Credentials are used the following way:
// Example App app = new App("app-id"); Credentials credentials = Credentials.emailPassword("email", "password"); User user = app.loginAsync(credentials, new App.Callback<User>() { public void onResult(Result<User> result) { if (result.isSuccess() { handleLogin(result.get()); } else { handleError(result.getError()); } } )); }
Nested Class Summary
Modificador y Tipo | Clase y descripción |
|---|---|
|
Resumen del método
Modificador y Tipo | Método y descripción |
|---|---|
public static Credentials | anonymous () Creates credentials representing an anonymous user. |
public static Credentials | |
public static Credentials | |
public String | asJson () Returns the credentials object serialized as a json string. |
public static Credentials | Creates credentials representing a remote function from MongoDB Realm using a Document which will be parsed as an argument to the remote function, so the keys must match the format and names the function expects. |
public static Credentials | Creates credentials representing a login using email and password. |
public static Credentials | |
public Credentials.Provider | Devuelve el proveedor de identidad utilizado para autenticarse. |
public static Credentials | Creates credentials representing a login using a GoogleAuthType.AUTH_CODE Google access token. |
public static Credentials | Crea credenciales que representan un inicio de sesión mediante un token de acceso de Google de un GoogleAuthType determinado. |
public static Credentials |
Inherited Methods
Methods inherited from class java.lang.Object :
getClass,hashCode,equals,clone,toString,notify,notifyAll,wait,wait,wait,finalize
Detalle del método
anónimo
public static Credentials anonymous () |
|---|
Creates credentials representing an anonymous user.Logging the user out again means that data is lost with no means of recovery and it isn't possible to share the user details across devices. The anonymous user must be linked to another real user to preserve data after a log out. Devuelve a set of credentials that can be used to log into MongoDB Realm using App.loginAsync(Credentials, App.Callback) . |
clave API
Creates credentials representing a login using a user API key.This provider must be enabled on MongoDB Realm to work. Parámetros
Devuelve a set of credentials that can be used to log into MongoDB Realm using App.loginAsync(Credentials, App.Callback) . |
manzana
Crea credenciales que representan un inicio de sesión mediante un token de ID de Apple. Este proveedor debe estar habilitado en MongoDB Realm para funcionar. Parámetros
Devuelve a set of credentials that can be used to log into MongoDB Realm using App.loginAsync(Credentials, App.Callback) . |
asJson
customFunction
Creates credentials representing a remote function from MongoDB Realm using a Document which will be parsed as an argument to the remote function, so the keys must match the format and names the function expects. Este proveedor debe estar habilitado en MongoDB Realm para funcionar. Parámetros
Devuelve a set of credentials that can be used to log into MongoDB Realm using App.loginAsync(Credentials, App.Callback) . |
emailPassword
Creates credentials representing a login using email and password. Parámetros
Devuelve a set of credentials that can be used to log into MongoDB Realm using App.loginAsync(Credentials, App.Callback) . |
Crea credenciales que representan un inicio de sesión mediante un token de acceso de Facebook. Este proveedor debe estar habilitado en MongoDB Realm para funcionar. Parámetros
Devuelve a set of credentials that can be used to log into MongoDB Realm using App.loginAsync(Credentials, App.Callback) . |
obtenerProveedorDeIdentidad
public Credentials.Provider getIdentityProvider () |
|---|
Devuelve el proveedor de identidad utilizado para autenticarse. Devuelve the provider identifying the chosen credentials. |
Creates credentials representing a login using a GoogleAuthType.AUTH_CODE Google access token. Este proveedor debe estar habilitado en MongoDB Realm para funcionar. Parámetros
Devuelve a set of credentials that can be used to log into MongoDB Realm using App.loginAsync(Credentials, App.Callback) . |
Crea credenciales que representan un inicio de sesión mediante un token de acceso de Google de un GoogleAuthType determinado. Este proveedor debe estar habilitado en MongoDB Realm para funcionar. Parámetros
Devuelve a set of credentials that can be used to log into MongoDB Realm using App.loginAsync(Credentials, App.Callback) . |
jwt
Creates credentials representing a login using a JWT Token. This token is normally generated after a custom OAuth2 login flow.This provider must be enabled on MongoDB Realm to work. Parámetros
Devuelve a set of credentials that can be used to log into MongoDB Realm using App.loginAsync(Credentials, App.Callback) . |