-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[feature/oauth2] Allow OAuth2 access/refresh tokens to be supplied #659
Conversation
Thank you @eddmann! @thefosk wrote the OAuth2 plugin and should be the one reviewing this. |
Great thanks :) |
On a side note, while I am reviewing this, it's also worthwhile investigating the "worker uuid seeds being the same" issue since that could happen somewhere else too. Including @Tieske in the conversation since we are using his https://github.com/Tieske/uuid library. |
@eddmann correct me if I am wrong - with your code the client would be able to set arbitrary |
@thefosk That is correct, so as to allow control of access/refresh tokens generated/used to remain with an existing system i.e legacy app |
@thefosk The intention of adding the ability to set arbitrary tokens is for the trusted 'Webapp Backend' to set them, not proxying values provided by the user, not sure if that is what you meant by client? |
@eddmann I was mentioning the client because I got confused by this integration test: https://github.com/Mashape/kong/pull/659/files#diff-0458d9c5302a8f52664b5c7dcc2ad586R366 It seems like the client is setting the |
f2d9a8c
to
f46926b
Compare
Available on password, client credential and refresh token grant types
73d9b42
to
9c87058
Compare
@thefosk Very good point, just spent sometime updating the pull request. Think it is probably easiest if I just layout more clearly what this feature is trying to achieve - as I don't think I have done the best of jobs, confusing matters by discussing the UUID bug within the initial description. This pull adds the ability to optionally supply the access (and in some cases refresh) tokens upon issue, providing that a valid provision key has been supplied. |
In order to provide a custom access tokens (with optionally a custom refresh token) I see that your implementation uses the proxy port, and now properly checks the Do you think it makes sense to being able to create/update/delete access tokens using the admin API instead? Let me explain better: like you already mentioned, I see this feature valuable when an API provider wants to migrate existing access tokens into Kong without any service disruption. But then, maybe we can add an additional endpoint on the admin API to do this and migrate all the access tokens? We don't need this to happen on the proxy port, because if a client knows the Thoughts? |
The latter approach will be implemented in #729 - which deprecates this PR. |
Whilst testing the OAuth2 plugin we noticed that a 500 error status was returned every so often when generating a new access token.
Having a look at the code and also this issue #478, we found that it was most likely due to worker uuid seeds being the same - causing duplicate 'random' access tokens.
This feature request adds the ability to supply the desired access/refresh tokens upon issue.