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 TokenResponseGenerator.CreateResponseAsync #1178

Merged
merged 5 commits into from Apr 1, 2023

Conversation

josephdecock
Copy link
Member

@josephdecock josephdecock commented Feb 8, 2023

In the TokenResponseGenerator, the ProcessTokenRequestAsync method, which generates access and refresh tokens and adds them to a response object, is now called by all token flows except the refresh token flow. This unifies the programming and extensibility model of the generator, which previously had duplicated code in some flows.

CreateResponseAsync is a new virtual method in the
TokenResponseGenerator. CreateResponseAsync does the same thing that
ProcessTokenRequestAsync used to do (generate access and refresh tokens
and add them to a response object), but it is called by all token flows
except the refresh token flow, which generates its tokens differently.

TokenResponseGenerator.ProcessTokenRequestAsync is now an alias for
CreateResponseAsync and is deprecated in favor of it, with the intention
to completely remove ProcessTokenRequestAsync in 7.0.
@brockallen
Copy link
Member

Ok, so let's do this:

  1. yes, update all the duplicated code to call into the single helper API
  2. no, let's leave the name of the old API the same (for the backwards compat reasons previously discussed)

But keep the refactor that unified code paths in the token response
generator.
@brockallen brockallen merged commit 9ff86fb into main Apr 1, 2023
5 checks passed
@brockallen
Copy link
Member

@josephdecock the above text doesn't quite match anymore.

@brockallen brockallen deleted the joe/token-response-gen-virtuals branch April 1, 2023 13:39
@josephdecock
Copy link
Member Author

Fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants