[Auth] Added authentication strategy for UIAM OAuth#256182
[Auth] Added authentication strategy for UIAM OAuth#256182elena-shostak merged 12 commits intoelastic:mainfrom
Conversation
x-pack/platform/plugins/shared/security/server/uiam/uiam_service.ts
Outdated
Show resolved
Hide resolved
b3d83ef to
9fb4d22
Compare
|
Pinging @elastic/kibana-security (Team:Security) |
|
ACK: Sorry for the delay, will finish review today. |
azasypkin
left a comment
There was a problem hiding this comment.
Looks good! Just a few questions and suggestions.
There was a problem hiding this comment.
note: I'm fine with the dedicated option, but options.config.uiam?.enabled is also available in the provider, since we always pass the full options object to the constructor via can use it directly.
There was a problem hiding this comment.
note: I see you pass this config value to set acceptUiamOAuth in the HTTP auth provider, but we also pass options.uiam to every provider (including HTTP), which is only non-null when options.config.uiam?.enabled is true. That's what we rely on in the SAML authc provider to decide whether we need to support UIAM flows. Dedicated option is fine by me too, but relying on options.uiam might be simpler and more consistent with the rest of the code base.
There was a problem hiding this comment.
question: do you know if there will be a way to distinguish OAuth UIAM tokens from any other UIAM credentials?
Since these are the only ones that come from outside with Bearer scheme it's not a problem for us, but it'd be great if these could be easily distinguishable these from other types of credentials.
There was a problem hiding this comment.
hmm, seems there is no easy way to do that, it has different type claim, but it doesn't help us much
There was a problem hiding this comment.
Roger that, thanks for checking!
There was a problem hiding this comment.
question: I'm wondering if it would be safer to do this inside the UIAM service itself, so we don't have to depend on the consumer to perform the check for us (and we won't need to pass expected audience as argument)?
There was a problem hiding this comment.
https://github.com/elastic/kibana/pull/256182/changes#diff-b18af47b9dc65be9cce719afafcd71875bd504c197bbc8c52de568a390967e2fR439-R442 I have added UiamServiceOptions that passes down es and kibana urls, so we can incapsulate the audience check inside exchangeOAuthToken method. Lmk if that's okay with you
There was a problem hiding this comment.
Yep, looks good to me, thanks 👍
x-pack/platform/plugins/shared/security/server/uiam/uiam_service.ts
Outdated
Show resolved
Hide resolved
...s/shared/security/test/scout_uiam_local/api/parallel_tests/uiam_oauth_token_exchange.spec.ts
Show resolved
Hide resolved
…ak/kibana into 2754-authentication-strategy
⏳ Build in-progress, with failures
Failed CI StepsTest Failures
History
|
…e_for_children6 * commit '3402744f63ca1196e97b11ffac4e7f7efab240df': (80 commits) [PerUserAuth] Add EARS auth type for Connectors V2 (elastic#253695) Fix `@elastic/eui/require-aria-label-for-modals` lint violations across `@elastic/kibana-core` files (elastic#259757) [Entity Analytics][Leads generation][4] Add API routes, LeadDataClient, and async generation (elastic#257046) [Agent Builder] Agent-centric UX redesign (elastic#258005) fix query streams failing test (elastic#260277) [Lens as code] Add list layout to the new API (elastic#259967) [FTR] Add warning comments to deployment-agnostic FTR base configs (elastic#260018) [Discover][Logs profile] Fix missing search highlights (elastic#260056) Plugin system: safe deletion (elastic#259038) [Infra] Fix Hosts filter options to match selected schema (elastic#259825) Manual Entity Resolution and flyout representation (elastic#260162) [Cascade] Handle grouping on fields with unset values (elastic#260033) [Fleet] generate OTel config for integration packages with otelcol inputs (elastic#259968) [Search] Switch over to V2 index management details (elastic#259866) [inference] increase timeout for ES inference calls (elastic#260382) [ES|QL] Enable subqueries (elastic#257455) [ES|QL] Change Point order free options (elastic#260282) [Auth] Added authentication strategy for UIAM OAuth (elastic#256182) [Security Solution] Add "alerts_candidate_count" rule execution metric (elastic#259917) [api-docs] 2026-03-31 Daily api_docs build (elastic#260380) ...
## Summary Added authentication strategy for UIAM OAuth. --- ### How to check ```shell ## Start Scout servers $ node scripts/scout.js start-server --arch serverless --domain security_complete --serverConfigSet uiam_local ## Run Scout tests $ npx playwright test --config x-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts \ --project local \ --grep "UIAM OAuth token exchange" ``` ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) __Closes: https://github.com/elastic/kibana-team/issues/2754__
## Summary Added authentication strategy for UIAM OAuth. --- ### How to check ```shell ## Start Scout servers $ node scripts/scout.js start-server --arch serverless --domain security_complete --serverConfigSet uiam_local ## Run Scout tests $ npx playwright test --config x-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts \ --project local \ --grep "UIAM OAuth token exchange" ``` ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) __Closes: https://github.com/elastic/kibana-team/issues/2754__
Summary
Added authentication strategy for UIAM OAuth.
How to check
Checklist
release_note:*label is applied per the guidelinesCloses: https://github.com/elastic/kibana-team/issues/2754