https://github.com/brainlife/auth
Simple, generic authentication service API and UI that issues JWT token
https://github.com/brainlife/auth
authentication jwt
Last synced: 3 months ago
JSON representation
Simple, generic authentication service API and UI that issues JWT token
- Host: GitHub
- URL: https://github.com/brainlife/auth
- Owner: brainlife
- License: mit
- Created: 2015-07-03T12:20:16.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2025-09-18T15:48:37.000Z (9 months ago)
- Last Synced: 2026-02-23T12:19:10.699Z (4 months ago)
- Topics: authentication, jwt
- Language: JavaScript
- Homepage:
- Size: 3.63 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/soichih/sca-auth)
[](https://coveralls.io/github/soichih/sca-auth?branch=master)
Generic authentication service that allows user to authenticate against variety of identity providers and issue JWT token. This service also provides role administration that can be used for authorization and group administrations.
Any services that then use authentication service's public key to validate the JWT token and do stateless authentication (and basic authorization through roles / groups)
For DB backend, it can use PostgreSQL, MySQL, MariaDB, or SQLite.
## Installation (pm2)
```
git clone git@github.com:brainlife/auth.git auth
cd auth && npm install
cd ui && npm install
```
You will need to create your configuration by copying `./api/config/index.js.sample` to `./api/config/index.js` (and edit the content)
You also need to create your public and private keys.
```
openssl genrsa -out auth.key 2048
chmod 600 auth.key
openssl rsa -in auth.key -pubout > auth.pub
```
## Installation (docker)
Create configuration file first
```
mkdir /etc/auth
cd /etc/auth
wget https://raw.githubusercontent.com/brainlife/auth/master/api/config/index.js.sample
cp index.js.sample index.js
```
And edit index.js. You need to point various paths to the right place. Just contact me if you aren't sure.
You also need to create public / prviate keys (see above for `openssl genrsa`)
Then, create auth container..
```
docker run \
--restart=always \
--name auth \
-v /etc/auth:/app/api/config \
-v /usr/local/data/auth:/db \
-d soichih/auth
```
You need to expose your container's port 80 (for UI) and 8080 (for API) directly, or via web proxy like nginx. Please feel free to contact me if you aren't sure how to do that.
# APIDOC
Once you have your UI up, you can view the API doc at `/apidoc` sub directory. Or you can see our hosted version at `https://sca.iu.edu/auth/apidoc/`