OAuth 2.0 Protected Resource Metadata endpoint#260773
Open
elena-shostak wants to merge 10 commits intoelastic:mainfrom
Open
OAuth 2.0 Protected Resource Metadata endpoint#260773elena-shostak wants to merge 10 commits intoelastic:mainfrom
elena-shostak wants to merge 10 commits intoelastic:mainfrom
Conversation
x-pack/platform/plugins/shared/security/server/routes/oauth_metadata/protected_resource.ts
Show resolved
Hide resolved
a031945 to
ff74af2
Compare
elena-shostak
commented
Apr 8, 2026
Comment on lines
+280
to
+282
| const expectedAudience = this.#kibanaServerURL.endsWith('/') | ||
| ? this.#kibanaServerURL | ||
| : `${this.#kibanaServerURL}/`; |
Contributor
Author
There was a problem hiding this comment.
Important
Claude's client normalizes the URL to the canonical form with an explicit path. UIAM should treat these as equivalent when comparing, but it doesn't right now, so appending trailing slash as temporary fix, otherwise we would get
Audience mismatch: expected http://localhost:5601 but token has http://localhost:5601/
Contributor
⏳ Build in-progress, with failures
Failed CI Steps
Test Failures
History
|
Contributor
|
Pinging @elastic/kibana-security (Team:Security) |
Ikuni17
reviewed
Apr 8, 2026
| * Override with `MOCK_IDP_KIBANA_URL`. | ||
| */ | ||
| async function extraDockerParamsForUiamOauthContainer(): Promise<string[]> { | ||
| const kibanaUrl = process.env.MOCK_IDP_KIBANA_URL ?? 'http://localhost:5601'; |
Contributor
There was a problem hiding this comment.
I think we'll want to pass in kibanaUrl from src/platform/packages/shared/kbn-es/src/utils/docker.ts instead of hard coding the URL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OAuth 2.0 Protected Resource Metadata endpoint https://datatracker.ietf.org/doc/rfc9728/
How to test
Note
You may need to add self signed certificate to
claude/settings.json"NODE_EXTRA_CA_CERTS": "<path_to_kibana>/src/platform/packages/shared/kbn-dev-utils/certs/ca.crt"You should get a clientId with response
{ "id": "<your_client_id>" "type": "public", "resource": "http://localhost:5601/", "creation": "2026-04-01T14:56:04.184718009Z", "revoked": false, "connections": { "active": [], "revoked": [] }, "client_name": "Claude Code", "client_metadata": {} }Should output
/mcpto start OAuth flowScreen.Recording.2026-04-08.at.13.23.44.mov
Checklist
Closes: https://github.com/elastic/kibana-team/issues/2750
Relates: #256182