Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nielskrijger/auth-server
OAuth2 authentication server designed to work in a docker-based microservices architecture.
https://github.com/nielskrijger/auth-server
Last synced: about 1 month ago
JSON representation
OAuth2 authentication server designed to work in a docker-based microservices architecture.
- Host: GitHub
- URL: https://github.com/nielskrijger/auth-server
- Owner: nielskrijger
- Created: 2015-02-09T21:56:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-03-12T17:03:44.000Z (over 9 years ago)
- Last Synced: 2024-04-14T06:08:07.226Z (3 months ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Lists
- awesome-microservice - OAuth2 authentication server designed to work in a docker-based microservices architecture.
- awesome-microservice - OAuth2 authentication server designed to work in a docker-based microservices architecture.
README
# auth-server
## Example
Run the following query:
curl -X POST -H "Content-Type:application/x-www-form-urlencoded" -H "Authorization: Basic dGVzdDpzZWNyZXQ=" -d "grant_type=password&username=johndoe&password=A3ddj3w" localhost:3000/oauth/token
## Dockerfile
If you're not using docker-compose you can build and tag a new image like this:
$ sudo docker build -t /auth-server .
Run the container in interactive mode:
$ sudo docker run -p 3000:3000 /auth-server
Run the container in detached mode:
$ sudo docker run -d -p 3000:3000 /auth-server
Now go to `http://localhost:3000` in your browser and you should see result!
## Tests
When contributing, please add tests! API tests using [supertest](https://github.com/visionmedia/supertest) are preferred.
## API
**POST** /user
```
{
email: '[email protected]',
password: 'myPassword',
roles: ['root']
}
```## Directory structure
The project is organized as follows:
/src - All files in here are copied to the Docker container.
/src/api - Contains request handlers excluding those in the `node-oauth2-server` library.
/src/boot - Contains scripts run each time when starting the server.
/src/config - Contains configuration files. You can overwrite most configuration variables with environment variables.
/src/lib - Contains singletons and generic functions.
/src/locales - Contains language files.
/src/models - Contains `mongoose` models.
/src/test - Contains API test files.
/src/test/* - Mimics the directory structure of files being tested.
/deploy - Contains files related to deployment and building the docker image.