-
Notifications
You must be signed in to change notification settings - Fork 88
add KEYCLOAK_TOKEN_ISSUER support and filter azd error messages #19
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
add KEYCLOAK_TOKEN_ISSUER support and filter azd error messages #19
Conversation
…in .env Add KEYCLOAK_TOKEN_ISSUER to fix JWT validation when Keycloak is behind HTTP routes: - Bicep: Pass keycloakTokenIssuer from main.bicep to server.bicep - Server: Set KEYCLOAK_TOKEN_ISSUER env var with fallback to KEYCLOAK_REALM_URL - Python: Use separate issuer URL for token validation vs realm URL for JWKS Fix write_env scripts to handle azd error output: - azd writes "ERROR: key not found" to stdout instead of stderr - Filter ERROR messages before writing to .env file - Prevents error text from polluting local environment files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request enhances the Keycloak authentication configuration by adding support for explicitly specifying the token issuer and improves the robustness of environment variable extraction scripts. The changes allow for more flexible Keycloak deployments where the token issuer URL differs from the realm URL, while also preventing error messages from being written to .env files.
Key Changes:
- Added
KEYCLOAK_TOKEN_ISSUERenvironment variable support throughout the deployment pipeline, with proper fallback toKEYCLOAK_REALM_URLwhen not set - Implemented error message filtering in environment generation scripts (
write_env.shandwrite_env.ps1) to prevent invalid values from being written whenazdcommands fail - Updated the Spanish README with comprehensive documentation covering all deployment scenarios and usage instructions
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| spanish/README.md | Complete translation update with expanded documentation for all deployment scenarios, local development, and authentication configurations |
| servers/auth_mcp.py | Added KEYCLOAK_TOKEN_ISSUER environment variable retrieval with fallback to KEYCLOAK_REALM_URL for JWT verification |
| infra/write_env.sh | Added error message filtering for Keycloak and Entra Proxy variables, plus support for writing KEYCLOAK_TOKEN_ISSUER to .env |
| infra/write_env.ps1 | PowerShell version of error filtering and KEYCLOAK_TOKEN_ISSUER support, maintaining parity with bash script |
| infra/server.bicep | Added keycloakTokenIssuer parameter and environment variable configuration with conditional fallback logic |
| infra/main.bicep | Added keycloakTokenIssuer parameter passing to server module and output variable for environment scripts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
This pull request enhances the Keycloak authentication configuration by introducing a new environment variable for the Keycloak token issuer and improving the robustness of environment variable extraction scripts. The main goal is to allow the token issuer to be explicitly set, which provides more flexibility and better alignment with various Keycloak deployment scenarios. Additionally, the scripts that generate environment files now filter out error messages from
azdcommands, preventing invalid values from being written.Keycloak authentication improvements:
KEYCLOAK_TOKEN_ISSUERenvironment variable, which is now passed through the deployment pipeline and used by the server for JWT verification. If not set, it defaults to the realm URL. [1] [2] [3] [4] [5]Deployment script robustness:
write_env.ps1andwrite_env.shto filter out error messages fromazdoutput when retrieving environment variables, preventing invalid values (such as error strings) from being written to the.envfile. This was applied to Keycloak and Entra Proxy related variables. [1] [2]