Skip to content

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

@dlorych

Description

@dlorych

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions