-
Notifications
You must be signed in to change notification settings - Fork 69
Description
Checklist
- I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved
We'd like the Auth0 SDK for the management API client to support using a custom token source. We would like to use our own token source so that we can more intelligently acquire tokens across multiple servers from a cache. This would in turn mean that we can use fewer M2M tokens and help us to stay under our M2M quota, as well as reducing the burden on the authorization server.
The issue is that the management does not support setting your own TokenSource. It does have various With options for setting token source such as WithClientCredentials: https://github.com/auth0/go-auth0/blob/main/management/management_option.go. This internally is used to configure the token source here: https://github.com/auth0/go-auth0/blob/main/management/management.go#L188-L195.
Describe the ideal solution
I am proposing that a new WithTokenSource option be added. If a token source is provided via this functional option, then use this when making requests. I can put up a PR for this work if it's helpful.
Alternatives and current workarounds
No response
Additional context
No response