This repo contains all the source code for the user 2 factor authentification controller. This endpoint is utilized by: user endpoint, register endpoint and login endpoint.
- http verb:
GET- reponse code:
200- response type: JSON
Returns a string
| param | description | type | default | required |
|---|---|---|---|---|
encoding |
The encoding type to use when generating a new user secret. | string | "base32" | true |
length |
The desired length of the secret to be generated | integer | 20 | true |
Creating a new secret
encoding: base32length: 20
Will yeild:
{
"secret": "IZSEKN2SLZASGVCUJY3WOPROGBKUWPRVG53EYUSXH5PGKOBTEVDA"
}
- http verb:
POST- reponse code:
200- response type: JSON
Returns a string
| param | description | type | default | required |
|---|---|---|---|---|
encoding |
The encoding type to use when generating a new user secret. | string | "base32" | true |
Creating a new token from secret
encoding: base32secret: KQ4GI6Z6OM6FIXSPPFOVOPTYGNZFCWD5NQSTS3TSMETDUMD2MNKQ
Will yeild:
{
"token": "717724",
"remaining": 29
}
- http verb:
POST- reponse code:
200- response type: JSON
Returns a string
| param | description | type | default | required |
|---|---|---|---|---|
secret |
The auth secret generated when user enabled two factor authentification | string | true | |
token |
The token to verify the secret against, sent to the user by email | integer | true |
Creating a new secret
secret: KQ4GI6Z6OM6FIXSPPFOVOPTYGNZFCWD5NQSTS3TSMETDUMD2MNKQtoken: 317729
Will yeild:
{
"valid": true,
"remaining": 18
}