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

Expose client secret rotation in typescript #728

Closed
joel-costigliola opened this issue May 24, 2022 · 1 comment
Closed

Expose client secret rotation in typescript #728

joel-costigliola opened this issue May 24, 2022 · 1 comment

Comments

@joel-costigliola
Copy link

Describe the problem you'd like to have solved

In in typescript, the ManagementClient class does not provide a way to rotate a client secret.

Describe the ideal solution

Expose client secret rotation in typescript ManagementClient class that call, the method should have a retry mechanism.

Alternatives and current work-arounds

Calling directly the Auth0 REST API with the access token retrieved from ManagementClient.

const managementAPIAccessToken = await this.managementClient.getAccessToken();
const requestOptions: AxiosRequestConfig = {
    url: `https://${auth0Domain}/api/v2/clients/${clientId}/rotate-secret`,
    method: "POST",
    headers: { "content-type": "application/json", authorization: `Bearer ${managementAPIAccessToken}` },
const { data } = await axios.request(requestOptions);
return data.client_secret;

This workaround does not handle retries, we have had a few 429 HTTP Errors that would have been handled by a retry mechanism, we will likely do that if that issue is not resolved in a reasonable future.

Additional information, if any

I was not sure whether to add a comment to #572, I created a new issue to avoid bloating #572.

Also found

rotateClientSecret(params, cb) {
that shows a client secret rotation but could not find the corresponding operation in https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/auth0/index.d.ts

@adamjmcgrath
Copy link
Contributor

Hi @joel-costigliola - thanks for raising this

We don't maintain the types currently, they're community maintained in DefinitelyTyped

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

2 participants