Subsections of users

User

This class allow make get request to user resource into Opengate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
Reference InternalOpenGateAPI to the API object.

changeApiKey(apiKey)

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a apiKey of a user

Parámetros

Nombre Tipo Opcional Descripción
apiKey String required field

Retorna

Tip

Tipo: Promise

Ejemplos

 ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changeApiKey(newPassword);

changePassword(newPassword)

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a password of a user

Parámetros

Nombre Tipo Opcional Descripción
newPassword String required field

Retorna

Tip

Tipo: Promise

Ejemplos

 ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changePassword(newPassword);

login(email, password, twoFaCode)

This invoke a request to OpenGate North API and the callback is managed by promises This function get a JWT for user with Two Factor Authorithation (optional)

Parámetros

Nombre Tipo Opcional Descripción
email String required field
password String required field
twoFaCode String optional field

Retorna

Tip

Tipo: Promise

Ejemplos

 ogapi.usersBuilder().login(email, password);
 ogapi.usersBuilder().login(email, password, twoFaCode);

requestResetPassword()

This invoke a request to OpenGate North API and the callback is managed by promises This function request for new password when the user forgets it. Sends a password recovery email

Retorna

Tip

Tipo: Promise

Ejemplos

 ogapi.usersBuilder().withEmail(example@example.es).requestResetPassword()

updatePassword(newPassword, tokenId)

This invoke a request to OpenGate North API and the callback is managed by promises This function updates a password of a user with a tokenId

Parámetros

Nombre Tipo Opcional Descripción
newPassword String required field
tokenId String required field

Retorna

Tip

Tipo: Promise

Ejemplos

 ogapi.usersBuilder().withEmail(example@example.es).updatePassword(newPassword, tokenid);

with2FaType(twoFaType)

Set the 2FaType attribute

Parámetros

Nombre Tipo Opcional Descripción
twoFaType string required field

Retorna

Tip

Tipo: User


withApiKey(apiKey)

Set the apiKey attribute. Only on update user

Parámetros

Nombre Tipo Opcional Descripción
apiKey string required field

Retorna

Tip

Tipo: User


withCountryCode(countryCode)

Set the countryCode attribute

Parámetros

Nombre Tipo Opcional Descripción
countryCode string required field

Retorna

Tip

Tipo: User


withDescription(description)

Set the description attribute

Parámetros

Nombre Tipo Opcional Descripción
description string required field

Retorna

Tip

Tipo: User


withDomain(domain)

Set the domain attribute

Parámetros

Nombre Tipo Opcional Descripción
domain string required field

Retorna

Tip

Tipo: User


withEmail(email)

Set the email attribute

Parámetros

Nombre Tipo Opcional Descripción
email string required field

Retorna

Tip

Tipo: User


withForcePasswordChange(forcePasswordChange)

Set the forcePasswordChange: if true Forces you to reset your password on your next login attempt.

Parámetros

Nombre Tipo Opcional Descripción
forcePasswordChange boolean

Retorna

Tip

Tipo: User


withLangCode(langCode)

Set the langCode attribute

Parámetros

Nombre Tipo Opcional Descripción
langCode string required field

Retorna

Tip

Tipo: User


withLoginWithPassword(loginWithPassword)

Enable or disable login with password

Parámetros

Nombre Tipo Opcional Descripción
loginWithPassword boolean

Retorna

Tip

Tipo: User


withName(name)

Set the name attribute

Parámetros

Nombre Tipo Opcional Descripción
name string required field

Retorna

Tip

Tipo: User


withPassword(password)

Set the password attribute

Parámetros

Nombre Tipo Opcional Descripción
password string required field

Retorna

Tip

Tipo: User


withProfile(profile)

Set the profile attribute

Parámetros

Nombre Tipo Opcional Descripción
profile string required field

Retorna

Tip

Tipo: User


withSurname(surname)

Set the surname attribute

Parámetros

Nombre Tipo Opcional Descripción
surname string required field

Retorna

Tip

Tipo: User


withTimezone(timezone)

Set the timezone attribute

Parámetros

Nombre Tipo Opcional Descripción
timezone string required field

Retorna

Tip

Tipo: User


withWorkgroup(workgroup)

Set the workgroup attribute

Parámetros

Nombre Tipo Opcional Descripción
workgroup string required field

Retorna

Tip

Tipo: User


User Finder

This class allow make get request to user resource into Opengate North API.

constructor

Constructor

Parámetros

Nombre Tipo Opcional Descripción
Reference InternalOpenGateAPI to the API object.

findByEmail(email)

Find a specify user by a email. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
email string Email of the user.

Retorna

Tip

Tipo: Promise


findByEmailAndPassword(email, password)

Find a specific user with apiKey by a email and password. This execute a GET http method

Parámetros

Nombre Tipo Opcional Descripción
email string Email of the user.
password string password of the user.

Retorna

Tip

Tipo: Promise