Add client credentials Private Key JWT auth for management API #528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔧 Changes
Add client credentials Private Key JWT auth for management API.
The
x/oauth2
package allows for adding extraEndpointParams
to client credentials config which allows for Private Key JWT to be used without implementation in the library. If we useAuthStyleInParams
, but do not add client ID or Secret, they will not get added to the request params.There is an open issue for implementing this in the library, but there seems to be no traction anymore for a long time. Therefore I wanted to suggest this solution.
If ok, I can start adding tests for it.
📚 References
x/oauth2
package: proposal: x/oauth2: support private_key_jwt client authentication golang/go#57186🔬 Testing
openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -pubout > public.pub
Run following
main.go
program:📝 Checklist