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

Client credentials flow does not support token issuer url with a path #70

Open
dlorych opened this issue Jan 4, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@dlorych
Copy link

dlorych commented Jan 4, 2024

Description

The OIDC authentication flow does not support token issuer urls containing a path, e.g. urls of Microsoft Entra ID.

Version of SDK

v0.3.0

Reproduction

fga client in version 0.2.1 (go-sdk v0.3.0) behaviour (replace and with your values):

$ fga store list --api-url http://localhost:8080 --client-id "$AZURE_CLIENT_ID" --client-secret "$AZURE_CLIENT_SECRET" --api-audience <api audience> --api-token-issuer "login.microsoftonline.com/<tenant id>"
Error: failed to initialize FGA Client due to Credentials are invalid: CredentialsConfig.ApiTokenIssuer (https://login.microsoftonline.com/<tenant id>) is in an invalid format

Expected behavior

API token URLs should support URLs with paths.

Additional context

The issue is caused by IsWellFormedUri function, which expects value to not contain path part.

Additionally, the value is used to build the final token URL value by adding a fixed /oauth/token path, which is not always a case - for example such URL in Microsoft Entra ID ends with either /oauth2/token or /oauth2/v2.0/token path.

@dlorych dlorych added the bug Something isn't working label Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant