feat: support multiple auth0 issuers for JWT verification#3978
Conversation
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
1 similar comment
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds support for validating JWTs from multiple Auth0 issuers by selecting the appropriate express-oauth2-jwt-bearer verifier based on the token’s iss claim.
Changes:
- Renames Auth0 config from a single
issuerBaseURLto comma-separatedissuerBaseURLs. - Updates OAuth2 middleware to parse
issuerBaseURLs, resolveissfrom the JWT payload, and dispatch to the matching verifier. - Updates environment variable mapping to use
CROWD_AUTH0_ISSUER_BASE_URLS.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| backend/src/conf/configTypes.ts | Renames Auth0 issuer config field to support multiple issuers. |
| backend/src/api/public/middlewares/oauth2Middleware.ts | Routes verification to the correct Auth0 issuer handler using the JWT iss claim. |
| backend/config/custom-environment-variables.json | Maps new multi-issuer env var name into config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
Summary
CROWD_AUTH0_ISSUER_BASE_URLSenv var.auth()handler by peeking at the JWTissclaim (base64 decode, no crypto overhead). Unknown issuers are rejected immediately.Note
High Risk
High risk because it changes JWT verification/issuer validation in the public API auth middleware; misconfiguration or parsing edge cases could cause unintended auth failures or issuer acceptance.
Overview
Auth0 JWT verification now supports multiple issuers. The OAuth2 middleware switches from a single
issuerBaseURLto a comma-separatedissuerBaseURLslist, selecting the correctexpress-oauth2-jwt-bearerverifier per request by decoding the JWTissclaim.Configuration is updated accordingly (new
CROWD_AUTH0_ISSUER_BASE_URLSenv var andAuth0Configuration.issuerBaseURLs), and requests with missing/malformed tokens or unknown issuers are rejected early.Written by Cursor Bugbot for commit 34ae438. This will update automatically on new commits. Configure here.