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

Can I custom access token retrieval Process in ManagementClient? #1050

Open
5 tasks done
cm-iwata opened this issue Nov 7, 2024 · 0 comments
Open
5 tasks done

Can I custom access token retrieval Process in ManagementClient? #1050

cm-iwata opened this issue Nov 7, 2024 · 0 comments

Comments

@cm-iwata
Copy link

cm-iwata commented Nov 7, 2024

Checklist

  • I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • I have looked into the API 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 searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

I'm trying to implement a process to call the Management API on AWS Lambda.

Since Lambda's execution environment scales horizontally, I want to cache the access token in SSM Parameter Store and share it across Lambda execution environments.

It seems that PR #793 allowed replacing the access token retrieval process with a custom-implemented function. I tried to implement a process using SSM Parameter Store utilizing this feature.
However, in the latest SDK version 4.11, the token constructor argument of ManagementClient is typed as string, making it impossible to replace it with a custom-implemented function.

export interface ManagementClientOptionsWithToken extends ManagementClientOptions {
token: string;
}

I couldn't find the reason why the modification in #793 was reverted. Is it currently not possible to customize the access token retrieval process?

Describe the ideal solution

same as #793

const auth0ManagementClient = new ManagementClient({
  token: () => Promise.resolve('my-token')
  clientId,
  domain,
  audience,
  scope,
});

Alternatives and current workarounds

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant