Skip to content
This repository was archived by the owner on Jan 23, 2021. It is now read-only.

keep-up-app/auth-api-endpoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auth Endpoint

Overview

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.

Endpoint URIs

  • /generate/secret

Description: generates new secret
  • http verb: GET
  • reponse code: 200
  • response type: JSON

Returns a string

Url Paramaters:
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

Usage

Creating a new secret

  • encoding: base32
  • length: 20

Will yeild:

{
    "secret": "IZSEKN2SLZASGVCUJY3WOPROGBKUWPRVG53EYUSXH5PGKOBTEVDA"
}

  • /generate/token

Description: generates a token based on secret
  • http verb: POST
  • reponse code: 200
  • response type: JSON

Returns a string

Url Paramaters:
param description type default required
encoding The encoding type to use when generating a new user secret. string "base32" true

Usage

Creating a new token from secret

  • encoding: base32
  • secret: KQ4GI6Z6OM6FIXSPPFOVOPTYGNZFCWD5NQSTS3TSMETDUMD2MNKQ

Will yeild:

{
    "token": "717724",
    "remaining": 29
}

  • /verify/token

Description: verifies token against secret
  • http verb: POST
  • reponse code: 200
  • response type: JSON

Returns a string

Url Body Paramaters:
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

Usage

Creating a new secret

  • secret: KQ4GI6Z6OM6FIXSPPFOVOPTYGNZFCWD5NQSTS3TSMETDUMD2MNKQ
  • token: 317729

Will yeild:

{
    "valid": true,
    "remaining": 18
}

About

Handles two factor authentication for KeepUp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors