pedroetb / node-oauth2-server-example Goto Github PK
View Code? Open in Web Editor NEWWorking oauth2 server with minimal configuration
License: MIT License
Working oauth2 server with minimal configuration
License: MIT License
Refresh token example missing in your model
after generating client_credentials token how is the token validated ? what is the endpoint for this.
In the readme for password grant under Body all paramters are in one line "grant_type=password&username=pedroetb&password=password", it should be three parameters:
grant_type=password
username=pedroetb
password=password
Hi Pedro,
maybe you might want to add these curl commands to your README.md file:
curl http://localhost:3000/oauth/token \
-d "grant_type=password" \
-d "username=pedroetb" \
-d "password=password" \
-d "client_id=application" \
-d "client_secret=secret" \
-H "Authentification: Basic YXBwbGljYXRpb246c2VjcmV0" \
-H "Content-Type: application/x-www-form-urlencoded" \
-v
This command returns for example:
{
"token_type":"bearer",
"access_token":"8fad8f87f2ebb262c917bc0abff9a798dea8ffa4",
"expires_in":3600
}
curl http://localhost:3000 \
-H "Authorization: Bearer c82b48de6507d5bd6b669a83f616351ee61a11fe" \
-v
returns
Congratulations, you are in a secret area!
Best,
Gabriel
I am new to this oauth framework.Can you brief the flow of your model
Also I want to know who supplies the accessToken to saveAccessToken() function.
Password grant type is working great, how do I switch to client credentials grant type ? what needs to change ?
Looking at the Oauth specs aren't we supposed to be returning expires_in instead of accessTokenExpiresAt in our response?
Hi Pedro, I'm new to all these stuff of NodeJs and node-oauth-server. I would love if you post an example like this but with client credentials grant, I did some research and saw that you must have the function getUserFromClient in the model required for auth, but I don't have any idea of how to do this, please Pedro could you help me?
Thanks a lot!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.