Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

req.user not available in grant flow #120

Closed
avnersorek opened this issue Oct 21, 2014 · 5 comments
Closed

req.user not available in grant flow #120

avnersorek opened this issue Oct 21, 2014 · 5 comments

Comments

@avnersorek
Copy link

I'd like to generate tokens using encryption/decryption - as briefly mentioned in https://auth0.com/blog/2014/01/27/ten-things-you-should-know-about-tokens-and-cookies/#token-oauth (points 8 & 9).
Thus removing the need to persist tokens.

For that I need to access the user and client info in the model.generateToken , but req.user is only available in the authorise flow and not while granting.

Also - req.client is already used by express.js.

Thanks

@thomseddon
Copy link
Member

Yeah this makes sense, I think we could just add an extra step before generateAccessToken where it adds in req.user and req.oauth.client ?

@avnersorek
Copy link
Author

Why not just add that to getClient and getUser ?
Those are called before generateAccessToken

@thomseddon
Copy link
Member

Yep, that could make even better sense! Happy to review a PR on this :)

@avnersorek
Copy link
Author

I'll get on it

@thomseddon
Copy link
Member

I'd like to change the way this is implemented, I haven't yet released the commit that fixed it but, to keep with convention, client will now be accessible req.oauth.client.clientId and req.oauth.client.clientSecret (as oppose to req.oauth.client.id & req.oauth.client.secret)

See: #143

thomseddon added a commit that referenced this issue Jan 26, 2015
nunofgs pushed a commit to seegno-forks/node-oauth2-server that referenced this issue Feb 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants