Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AuthenticationContextInterface

Context of the authenticate operation.

Hierarchy

Properties

Optional Readonly device

device: null | HttpDevice

Device from where request has been made.

Readonly deviceId

deviceId: string

Id of the client device. It is used as id to authentication session which links together authentication steps (e.g. password -> recaptcha -> multi factor).
Usually you will either hash User-Agent header or BaseContext.device, or will send custom device id from your app client (which isn't always secure approach).

Optional Readonly generateChallenge

generateChallenge: boolean

Perform password-less authentication using challenge-response mechanism.
When given this option, library will generate a nonce and store it in the AuthenticationStatus.token with the AuthenticationStatus.nextStep equal to AuthenticationStepName.CHALLENGE_RESPONSE.
When client receives nonce, he should encrypt it with his Private Key that is paired with Public Key stored on the server at account registration (e.g. AccountModel.pubKey this one).

Readonly ip

ip: string

Ip from where request has been made.

Optional Readonly location

location: null | HTTPRequestLocation

Location from where request has been made.

Optional Readonly password

password: string

Password of the client. This is required only for password authentication in the AuthenticationStepName.PASSWORD and AuthenticationStepName.RECAPTCHA steps.
When client receives these steps as response from server, it needs to send back his password.

Optional Readonly recaptcha

recaptcha: string

Optional Readonly responseForChallenge

responseForChallenge: object

Response for nonce sent in the AuthenticationStepName.GENERATE_CHALLENGE step.
This option needs to be set only after nonce has been generated and sent to client.

Type declaration

Optional Readonly twoFactorAuthenticationToken

twoFactorAuthenticationToken: string

Two factor authentication token. This is required only for password authentication in the AuthenticationStepName.TWO_FACTOR_AUTH_CHECK step.
When client receives this step as response from server, it needs to send back his 2fa token.

Readonly username

username: string

Username of the client. Needs to be given always, as it acts like an identifier.