go-auth-library
v1.1.9
Published
Create different methods to authenticate a user.
Downloads
12
Readme
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