Giter Site home page Giter Site logo

pedroetb / node-oauth2-server-mongo-example Goto Github PK

View Code? Open in Web Editor NEW
103.0 6.0 53.0 76 KB

Working oauth2 server with mongodb storage and minimal configuration

License: MIT License

JavaScript 100.00%
oauth2-server oauth2 oauth mongodb-storage mongodb nodejs

node-oauth2-server-mongo-example's Issues

Invalid grant: refresh token is invalid

Hello all, When I received a new token from the Refresh_token grant type I encountered "Invalid grant: refresh token is invalid". I stored tokens with AWS DynamoDB. In line of 135 in node-oauth2-server-mongo-example/model.js file is referred to as token.client.id is client.clientId. It's not working for me. I tried to store the client.id instead of client.clientId. It's working fine now. Thanks for the oauth2-server example.

switch to client credentials grant type

Password grant type is working great - i can generate a toke.
I need to use the client_credentials grant type. What code change needs to be made to use it ?

Can't generate refresh token with grant type refresh_token

I tried your example,still error when use refresh_token type,got below error

curl http://localhost:3000/oauth/token \
> -d "grant_type=refresh_token" \
> -d "client_id=application" \
> -d "client_secret=secret" \
> -d "refresh_token=5de9099aa1925063d05b75c4cca4377c9f9982ea" \
> -H "Authorization: Basic YXBwbGljYXRpb246c2VjcmV0" \
> -H "Content-Type: application/x-www-form-urlencoded"
{"statusCode":400,"status":400,"code":400,"message":"Unauthorized client: `grant_type` is invalid","name":"unauthorized_client"}

HTTPS instead of HTTP

what needs to be modified to use HTTPS instead of HTTP ? is this possible for Oauth2-Server

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.