jaredhanson / jaredhanson/oauth2orize

Returning message with redirect_uri

Open
#133 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.5k
Forks
472
PR merge metrics
No merged PRs in 30d

Description

I have successfully implemented an OAuth2 server in my application, I am trying to return the failure message to the user, such as 'Incorrect username/password', my local strategy looks like this now:

```
passport.use(new LocalStrategy(function(username, password, callback){
User.login(username, password, function (err, user, response) {
if (err) {
callback(err);
} else {
if (user) {
callback(null, user);
} else {
callback(response.message); // this is the failure message 'Incorrect username/password'
}
}
});
}));
```

With this implementation, I can show the message to users in the very simple, clean and clear webpage.

Can I pass the message to the client's redirect_uri, something like:
`http://OAuth2Client.com/auth/OAuth2Provider/callback?message=Incorrect%20username%2Fpassword`

Contributor guide

Open the contributing guide

Research direction

Start with the local strategy callback and the authorization redirect_uri/callback flow described in the issue. Review the repository's existing redirect handling to determine whether a failure message can be passed safely and consistently; done should mean the supported behavior is defined and covered by an appropriate test or documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.