go-auth-library
TypeScript icon, indicating that this package has built-in type declarations

1.1.9 • Public • Published

Objectives

Create different methods to authenticate a user.

  • create a connection to the DB.
  • check user credentials match.
  • thrid party connection.
  • return user with roles and permissions.

Methods: isAuthtenticated.

Parameters

  • DB credentials.

  • Google oAuth2 keys

Routes.

  • login POST:

    receive the credentials base64 format in basic Auth headers.

  • refresh_token POST:

    Generate a new token and refresh token using the old refresh token

  • logout DELETE:

    Remove the token and refresh token

  • google oAuth2

    get google authorization and save the token an refresh token. continue our flow to exchange the token. to refresh token verify again with google.

Middleware.

  • Token extractor.

    get the token from Authorization Header

  • Toke verification

    verify the token to be valid.

https://nimb.ws/3mEP9J

Publication

https://github.com/sindresorhus/np https://www.npmjs.com/package/go-auth-library

Doc: https://app.gitbook.com/@ventura/s/docs/microservices/go-auth-lib

Readme

Keywords

none

Package Sidebar

Install

npm i go-auth-library

Weekly Downloads

29

Version

1.1.9

License

ISC

Unpacked Size

139 kB

Total Files

39

Last publish

Collaborators

  • jechav