Comments (2)
I am looking for something similar.
The token() method returns an error in the following format in case a wrong set of credentials is used.
{ "error": "invalid_grant", "error_description": "Invalid grant: user credentials are invalid" }
What I intend to do is to return an appropriate error_description depending on the reason for grant failure. Example: User account does not exist. User account is not verified. Incorrect password.
Does anyone have any idea of how I could achieve this?
from express-oauth-server.
@esteban-filardi you can access response of the token()
method by accessing it from the response which will be available to you in the next handler, res.locals.oauth.token
. Refer https://github.com/oauthjs/express-oauth-server/blob/master/index.js#L116
from express-oauth-server.
Related Issues (20)
- Please fix vulnerabilities/warning "Versions of lodash before 4.17.5 are vulnerable to prototype pollution" HOT 2
- Converted to typescript (working code) HOT 2
- "body-parser" should not be dev-dependency HOT 2
- Generator Function without yelt
- Travis
- Can someone either document or clarify the use case difference between client.id and client.clientId
- Followed the sample but getting 401 for the /public route HOT 1
- Update Lodash to 4.17.21 HOT 2
- Question - is it still under any maintenance? HOT 1
- Is implementing Resource Owner Password Credentials grant type? HOT 1
- oauth not responding HOT 4
- why dont you add a proper working example project in repo?? HOT 1
- app.oauth.authenticate middleware behavior HOT 1
- Mixing `oauth2-server` versions breaks `instanceof` Require
- `/login` and `.token()` usage HOT 1
- Cannot read property '0' of undefined HOT 1
- npm audit said lodash need to update to 4.17.5 or higher HOT 2
- New Example Provided Implementing Authorization Code and Refresh Token HOT 4
- Missing parameter 'accessToken' when invoking token() HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from express-oauth-server.