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

add custom 'afterTokenVerified' function (similar to beforeCreateToken) after succesfull verification in volos-oauth #51

Open
borisirota opened this issue Jan 1, 2015 · 2 comments

Comments

@borisirota
Copy link

Hi,

Add user defined function to the token verification flow that receives the verification result and the callback. This function will be able to return customized data that will be attached to the token attribute instead of the current token's verification data.
More custom way is to pass the req object to this function in order to be able to attach user's defined attributes to the req object but it requires some fundamental changes in the implementation.

Adding this kind of operation will make the authentication process more customizable from user perspective and this support will be similar to passport's serialize\deserialize methods (e.g. in beforeCreateToken we can store user's id in attributes and in afterTokenVerified it will be possible to get the user from the database and attach to the request).

To support this it requires:

  1. Be able to add afterTokenVerified to x-a127-services:oauth2:options in swagger.yaml.
  2. Duplicate this check only with afterTokenVerified attribute.
  3. Duplicate this only with afterTokenVerified attribute.
  4. Call the method instead of this callback
  5. If no function supplied, the current behavior is the default.

Thanks,
Boris

@theganyo
Copy link
Contributor

This sounds like a great addition. Do you want to submit a PR? Otherwise, I'll look into this (hopefully) soon.

@borisirota
Copy link
Author

I'm not sure that I need it. will decide soon. If I do, so of course.

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