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

Configurability of token fetch endpoints #505

Closed
avin45h opened this issue Jun 15, 2020 · 3 comments
Closed

Configurability of token fetch endpoints #505

avin45h opened this issue Jun 15, 2020 · 3 comments
Labels
feature request A feature has been asked for or suggested by the community question Further information is requested

Comments

@avin45h
Copy link

avin45h commented Jun 15, 2020

We have a scenario where we are using different endpoint for fetching token. When I execute
handleRedirectCallback method on auth instance, it fetches the oauth token. However the token end point for fetching this has a hardcoded suffix. Can we add support of configuring these endpoints?

src/utils.ts:301

export const oauthToken = async (
  { baseUrl, timeout, ...options }: TokenEndpointOptions,
  worker
) =>
  await getJSON(
    `${baseUrl}/oauth/token`,
    timeout,
    {
      method: 'POST',
      body: JSON.stringify({
        redirect_uri: window.location.origin,
        ...options
      }),
      headers: {
        'Content-type': 'application/json'
      }
    },
    worker
  );```
@avin45h avin45h added the feature request A feature has been asked for or suggested by the community label Jun 15, 2020
@adamjmcgrath
Copy link
Contributor

Hi @avin45h - thanks for raising an issue

baseUrl is derived from the domain argument, which should be your auth0 account domain https://auth0.github.io/auth0-spa-js/interfaces/auth0clientoptions.html#domain

Can you tell me more about your use case? Like why you would want to use a different domain for the token endpoint, and why you wouldn't want this to be the same domain as the /authorize endpoint?

@adamjmcgrath adamjmcgrath added the question Further information is requested label Jun 15, 2020
@avin45h
Copy link
Author

avin45h commented Jun 15, 2020

Hi @adamjmcgrath
We have a server for oauth where we fetch meta data from .well-known/openid-configuration

I want to keep same domain argument, however we have a token endpoint entry defined which I want to use for fetching token
token_endpoint : "<baseURL>/connect/token"

Since the endpoint for token fetch is hardcoded (not the base URL part), I can't use the above endpoint.

@adamjmcgrath
Copy link
Contributor

Hi @avin45h - thanks for clarifying

Currently, the scope of this library is only for use with Auth0's authorization server, so we wont be able to accommodate this feature request - apologies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature has been asked for or suggested by the community question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants