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

Allow specifying OAuth Token URL in ClientCredentials #66

Closed
hkarn-godaddy opened this issue Mar 15, 2024 · 2 comments
Closed

Allow specifying OAuth Token URL in ClientCredentials #66

hkarn-godaddy opened this issue Mar 15, 2024 · 2 comments

Comments

@hkarn-godaddy
Copy link

Describe the problem you'd like to have solved

You can specify apiTokenIssuer in ClientCredentials but the token path always defaults to "/oauth/token". That may not always be true as for me it's /oauth2/token.

I need to create a separate OAuth client and manage token manually.

Describe the ideal solution

Replace or add a new field in ClientCredentials to accept apiTokenURL (the entire path) or optionally add a field to allow overriding DEFAULT_API_TOKEN_ISSUER_PATH in OAuth2Client.

Alternatives and current workarounds

Create a separate OAuth client and manage token manually.

Additional context

None.

@rhamzeh
Copy link
Member

rhamzeh commented Mar 15, 2024

Hi @hkarn-godaddy - what version of the SDK are you using?

This should be already possible as of v0.3.0 thanks to this PR by @le-yams openfga/sdk-generator#240

You can set the API Token Issuer as follows:

ApiTokenIssuer Endpoint SDK will hit
issuer.fga.example https://issuer.fga.example/oauth/token
https://issuer.fga.example https://issuer.fga.example/oauth/token
https://issuer.fga.example:8080 https://issuer.fga.example:8080/oauth/token
issuer.fga.example/some_endpoint https://issuer.fga.example/some_endpoint
https://issuer.fga.example/some_endpoint https://issuer.fga.example/some_endpoint
https://issuer.fga.example:8080/some_endpoint https://issuer.fga.example:8080/some_endpoint

(note: this is only currently supported in the Java and Go SDKs, but we're hoping to bring it to the other SDKs soon)

@hkarn-godaddy
Copy link
Author

Sorry. You are right. This already works in the new version. Closing request.

@github-project-automation github-project-automation bot moved this from Backlog to Done in SDKs and Tooling Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants