Skip to content

jrichardsz/oauth2-shield

Repository files navigation

Oauth2 Shield

A minimal, fast and ready to use oauth2 implementation.

Endpoints

Endpoint description
/oauth2/credentials client id & client secret generator
/oauth2/token access_token generation
/oauth2/introspect return meta information surrounding the token

Oauth2 Flow

Check this guideline

Prerequisites

  • Linux
  • Nodejs >= 8
  • Mysql = 5.7.*
    • Another version, show errors and unexpected behaviors
    • Execute sql script : /ddl.sql

Required variables

Variable Description
token_secret alphanumeric string required to jwt token generation
token_life string representation of token expiration time. Example: 10s, 50m, 1h,etc
database_host mysql database host. Ip or domain
database_user user to login into mysql database host.
database_password password related to database_user.
database_port mysql port. Most of the time is 3306
database_name name of database.
database_connection_management database connection type: single or pool. Default: single
database_connection_pool_limit The maximum number of database connections to create at once. Check this
auth_realm alphanumeric string required to basic auth entropy.
auth_user user to perform requests to /oauth2/credentials endpoint .
auth_password password related to auth_user
TZ Linux timezone. IMPORTANT FOR DATES AND EXPIRATION TIME. Example: 'America/Lima'

More details about required variables here

Run for Developers

Just

npm install

Export required variables, startup your mysql

And execute

npm run dev

Run in Production environments

Just

npm install

Export required variables, startup your mysql

And execute

npm run start

Run with Docker

Check this guideline

Unit Testing

Check this guideline

Wiki

Check this

TO-DO

  • More unit tests
  • Add UI for management
  • Upload to public docker hub
  • Add docker-compose

Contributors


Richard Leon

About

A minimal, fast and ready to use oauth2 implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published