Skip to content
OAuth2 Server + MoleculerJS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
src lint message error May 6, 2019
.babelrc
.dockerignore first commit :) Nov 7, 2018
.eslintignore first commit :) Nov 7, 2018
.eslintrc first commit :) Nov 7, 2018
.gitignore first commit :) Nov 7, 2018
.prettierrc first commit :) Nov 7, 2018
Dockerfile first commit :) Nov 7, 2018
LICENSE
README.md fix md format May 6, 2019
docker-compose.yml remove nats May 6, 2019
oauth2-moleculer.postman_collection.json fix POST token May 6, 2019
package.json update dependecies May 6, 2019

README.md

OAuth2 Server + MoleculerJS

This project is an example of how to implement OAuth2 Server with MoleculerJS, I pretend to convert this into a module of MoleculerJS in the future.

The project’s base is a database (mysql) and the repository.mixin.js which is basically a moleculer-db-adapter, I’ve created it because I had some difficulties working with a lot of entities using the ‘moleculer-db’, but in other words, have the same purpose.

The main project’s file is the oauth_server.mixin.js, I have the methods of OAuth Server into it and I've implemented the authenticate which will be inserted into the API Gateway and will be basically the authentication method, after that I can protect, or not, an API endpoint using the option authorization.

Getting started

npm run clear
npm run seeders

Import the collection for your Postman and enjoy

References:

https://github.com/dsquier/oauth2-server-php-mysql
https://github.com/manjeshpv/node-oauth2-server-implementation
https://moleculer.services/docs/0.13/moleculer-web.html#Authentication

You can’t perform that action at this time.