You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* keycloak and vscode
* Add VS Code GitHub Copilot integration docs for Keycloak OAuth
- Add "Use Keycloak OAuth MCP server with GitHub Copilot" section to README
- Add step-by-step instructions for connecting VS Code to deployed MCP server
- Include screenshots for authentication flow (allow access, sign-in, redirect)
- Add Spanish translation of the new section to spanish/README.md
- Configure VS Code redirect URIs in Keycloak realm for DCR support
- Update infra and keycloak configs for VS Code OAuth redirect handling
* update with credit
* ruff run
* ruff run again
* attemtp to get audience validation
* Refactor Keycloak auth with scope injection and proxying
* add openid scope
* remove mcp url
* ruff
* clean up to realm so it has only what we need
* addresses feedback from Pamela and Copilot
Copy file name to clipboardExpand all lines: README.md
+33-10Lines changed: 33 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -432,23 +432,46 @@ This project supports deploying with OAuth 2.0 authentication using Keycloak as
432
432
433
433
Login with `admin` and your configured password.
434
434
435
-
### Testing with the agent
436
435
437
-
1. Generate the local environment file (automatically created after `azd up`):
436
+
### Use Keycloak OAuth MCP server with GitHub Copilot
438
437
439
-
```bash
440
-
./infra/write_env.sh
441
-
```
438
+
The Keycloak deployment supports Dynamic Client Registration (DCR), which allows VS Code to automatically register as an OAuth client. VS Code redirect URIs are pre-configured in the Keycloak realm.
439
+
440
+
To use the deployed MCP server with GitHub Copilot Chat:
441
+
442
+
1. To avoid conflicts, stop the MCP servers from `mcp.json` and disable the expense MCP servers in GitHub Copilot Chat tools.
443
+
2. Select "MCP: Add Server" from the VS Code Command Palette
444
+
3. Select "HTTP" as the server type
445
+
4. Enter the URL of the MCP server from `azd env get-value MCP_SERVER_URL`
446
+
5. You should see a Keycloak authentication screen open in your browser. Select "Allow access":
442
447
443
-
This creates `.env` with `KEYCLOAK_REALM_URL`, `MCP_SERVER_URL`, and Azure OpenAI settings.
7. After authentication, the browser will redirect back to VS Code:
455
+
456
+

457
+
458
+
8. Enable the MCP server in GitHub Copilot Chat tools:
459
+
460
+

461
+
462
+
9. Test it with an expense tracking query:
463
+
464
+
```text
465
+
Log expense for 75 dollars of office supplies on my visa last Friday
449
466
```
450
467
451
-
The agent automatically detects `KEYCLOAK_REALM_URL` in the environment and authenticates via DCR + client credentials. On success, it will add an expense and print the result.
468
+

469
+
470
+
10. Verify the expense was added by checking the Cosmos DB `user-expenses` container in the Azure Portal or by asking GitHub Copilot Chat:
0 commit comments