-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat(java-sdk): configurable token endpoint #240
feat(java-sdk): configurable token endpoint #240
Conversation
293fdd7
to
555a773
Compare
Thanks for taking the time to put this together. Can you help me understand the problem you are trying to solve? Do you need to customize the protocol/scheme (currently hardcoded as If possible, I'd rather allow those parts to be configured independently rather than override everything (including/duplicating the issuer) |
Sorry I wasn't clear enough. The problem I'd like to solve is : using a different token endpoint than the currently hardcoded as
The second solution is less trivial to implement and only work if the authority server support oidc so the PR is about the first one.
That's a good point and I indeed asked myself if I should make only the path configurable rather than the full url. So maybe the proper way would be to replace the "issuer" input with a "tokenEndpoint" one (so the sdk user directly specify the full token and thus make the implicit explicit). That's just my thought and I look forward to yours :) Thanks for taking the time into looking at this PR 😄 |
555a773
to
234e1cd
Compare
Hi @le-yams - sorry about taking time to respond. Just wanted to first say thanks a lot for working on this ❤️ We'll gladly accept the contribution, but may I ask for some changes? Instead of introducing a new field, we'd rather change the
Of course, we'll need to do some of the validations to ensure e.g. people are passing fields with See for example the change we introduced in the last release of the Go SDK: openfga/go-sdk@cdd7206 |
234e1cd
to
d973ac2
Compare
Hi @rhamzeh , I updated the PR according to your comment. I made the test cover all the cases you mentioned (plus some with the authority having a final |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @le-yams!
There's some minor things to be done:
- renaming tokenEndpointUrl to
apiTokenIssuer
- validating that the scheme is
http
/https
- adding tests for invalid schemes/uris
But we'll do that in a separate PR after merging.
Expect this PR to go out in the next v0.3.0
release, to be out soon
Configurable client_credentials token endpoint for the Java SDK.
Description
Add a
tokenEndpoint
property to theClientCredentials
class. TheOAuth2Client
use this property value if not null/blank to query the token. If the property is not set, the previous behavior is applied (default to<issuer>/oauth/token
).References
#238
Review Checklist
main