Skip to content

Inconsistency in OIDC token path construction between SDKs (and incompaibility with custom token paths) #141

Open
@danielloader

Description

@danielloader

Checklist

  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of OpenFGA and the issue still persists.
  • I have searched the Slack community and have not found a suitable solution or answer.
  • I agree to the terms within the OpenFGA Code of Conduct.

Description

There's a feature gap in the JS SDK that's causing us to be unable to use OIDC auth in the SDK (and it's inconsistent elsewhere too).

Golang (I'm taking to be the reference SDK by default here):

JS:

  • url: `https://${clientCredentials.apiTokenIssuer}/oauth/token`,
  • Regardless of the path string you give, you get the https:// prefix added, and you can't stop the suffix being added.

Python:

Dotnet:

Java:

This has been a blocker for us because Zitadel uses /oauth/v2/token as its token endpoint, so the JS SDK is trying to call https://auth.example.com/oauth/v2/token/oauth/token instead of https://auth.example.com/oauth/v2/token.

Expectation

All the SDKs to have the same configuration interface so I can use OIDC.

Reproduction

  1. Try to use OIDC auth on OpenFGA with the JS SDK.
  2. Use an Oauth2 provider with a non default path to the token off the base domain.
  3. Fail to get token.

OpenFGA SDK version

0.6.2

OpenFGA version

1.5.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions