Aller au contenu principal

auth

Authentification de l'utilisateur.

AuthProvider?.auth( marker?, body? );

Exemple minimal

const body = {
"authData": [?
{
"marker": "login",?
},
{
"marker": "password",?
"value":"12345"?
}
],
};

const value = await AuthProvider.auth('email', body)
Schéma

marker(obligatoire): string
L'identifiant textuel du fournisseur d'autorisation
exemple: "email"

data(obligatoire): IAuthPostBody
Tableau d'objets contenant les informations d'authentification
exemple:

{
"authData": [
{
"marker": "login",
"value": "example@oneentry.cloud"
},
{
"marker": "password",
"value": "12345"
}
]
}

body.authData any[]
Données d'autorisation prises du formulaire attaché au fournisseur d'autorisation
exemple: ""

[
{
"marker": "login",
"value": "example@oneentry.cloud"
},
{
"marker": "password",
"value": "12345"
}
]

body.authData[index].marker string
Attribut de connexion du formulaire d'inscription
exemple: "example@oneentry.cloud"

body.authData[index].value string
Valeur de l'attribut de connexion du formulaire d'inscription
exemple: "12345"

Cette méthode effectue l'autorisation de l'utilisateur. Renvoie un objet avec un ensemble de jetons.

Exemple de réponse

{
"userIdentifier": "test@test.ru",
"authProviderIdentifier": "email",
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwiYXV0aFByb3ZpZGVySWRlbnRpZmllciI6ImVtYWlsIiwidXNlcklkZW50aWZpZXIiOiJ0ZXN0QHRlc3QucnUiLCJ1c2VyQWdlbnQiOiJub2RlIiwiaWF0IjoxNzUzMDkwODAzLCJleHAiOjE3NTMxMjY4MDN9.A7GkUmqKcKDKCcSVV9FITqOD0LebvgurvIUMqzy7E4w",
"refreshToken": "1753090803738-11c4d812-662e-42c6-a08e-4d882e493bfb"
}
Schéma

userIdentifier: string
L'identifiant unique pour l'utilisateur.
exemple: "user12345"

authProviderIdentifier: string
L'identifiant pour le fournisseur d'authentification.
exemple: "email"

accessToken: string
Le jeton d'accès pour la session utilisateur.
exemple: "abcdef123456"

refreshToken: string
Le jeton de rafraîchissement pour renouveler le jeton d'accès.
exemple: "ghijkl789012"