Skip to content

bug-1685143: Changed Auth0 Audience URL#7202

Open
Haseeb702 wants to merge 1 commit into
mainfrom
change-auth0-audience
Open

bug-1685143: Changed Auth0 Audience URL#7202
Haseeb702 wants to merge 1 commit into
mainfrom
change-auth0-audience

Conversation

@Haseeb702
Copy link
Copy Markdown
Contributor

@Haseeb702 Haseeb702 commented May 15, 2026

Because:

  • The auditgroups cronjob is raising a 403 error in the function get_access_token, meaning the Auth0 API is not able to query the users
  • This error occurs because the audience parameter in the request payload points to the external domain behind a Fastly WAF (This ticket shows some context on the domain change in socorro: CRINGE-135)
  • The Auth0 management API only has a single identifier, thus we need to switch to using that single internal domain URL so that the Auth0 management API can generate a valid access token.

This PR:

  • Adds a new config variable for the Auth0 management endpoint: AUTH0_MANAGEMENT_API_ENDPOINT.
  • Updates the new variable to be used for the audience parameter in the get_access_token function.

@Haseeb702 Haseeb702 requested a review from a team as a code owner May 15, 2026 18:48
Copy link
Copy Markdown
Contributor

@biancadanforth biancadanforth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some high level feedback:

  • Your commit subject isn't following our commit subject conventions per the Socorro docs. Ideally we'd have some kind of automated enforcement of this, but we don't. Can you update it?
  • In terms of the substance of the PR title/commit message and PR description, you're not really explaining what the issue was, or what caused it.
    • This PR is a resource for the reviewer at the time the patch is written, but also an artifact for future reference and should accurately reflect what the issue was and why the change is needed. Just saying it's a different and correct URL doesn't explain why the previous URL didn't work. I know in this case we don't want to mention the URL values explicitly, but we can still go a bit further in explaining the bug and the fix. If you have questions about the root cause or why this fixes it, please ask!

OIDC_OP_AUTHORIZATION_ENDPOINT = _config("OIDC_OP_AUTHORIZATION_ENDPOINT", default="")
OIDC_OP_TOKEN_ENDPOINT = _config("OIDC_OP_TOKEN_ENDPOINT", default="")
OIDC_OP_USER_ENDPOINT = _config("OIDC_OP_USER_ENDPOINT", default="")
AUTH0_MANAGEMENT_API_ENDPOINT = _config("AUTH0_MANAGEMENT_API_ENDPOINT", default="")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has an empty string as a default value -- is it set in the environment for local dev? If not, I don't think socorro will start up locally (or at least, we won't be able to run this cron job locally). Can you test this? You'll likely need to add the config to local_dev.env as the other OIDC* config are there as well.

Also, I think this group makes sense to put this new config, but can you put it in alphabetical order?

Also also, I regret including "Auth0" in the variable name. Auth0 is a provider for the OIDC protocol standard. But we may change providers in the future, in which case this variable name won't make sense. I'm not going to make you change it; just something to keep in mind in the future for naming variables. Naming things is hard!

@Haseeb702 Haseeb702 force-pushed the change-auth0-audience branch from 223ab8d to faa8808 Compare May 15, 2026 20:18
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

Successfully merging this pull request may close these issues.

2 participants