Skip to content

[Auth] Added authentication strategy for UIAM OAuth#256182

Merged
elena-shostak merged 12 commits intoelastic:mainfrom
elena-shostak:2754-authentication-strategy
Mar 31, 2026
Merged

[Auth] Added authentication strategy for UIAM OAuth#256182
elena-shostak merged 12 commits intoelastic:mainfrom
elena-shostak:2754-authentication-strategy

Conversation

@elena-shostak
Copy link
Copy Markdown
Contributor

@elena-shostak elena-shostak commented Mar 5, 2026

Summary

Added authentication strategy for UIAM OAuth.


How to check

## 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

  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

Closes: https://github.com/elastic/kibana-team/issues/2754

@elena-shostak elena-shostak added backport:skip This PR does not require backporting release_note:enhancement release_note:skip Skip the PR/issue when compiling release notes Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// and removed release_note:enhancement labels Mar 6, 2026
@elena-shostak elena-shostak force-pushed the 2754-authentication-strategy branch from b3d83ef to 9fb4d22 Compare March 6, 2026 19:37
@elena-shostak elena-shostak requested a review from azasypkin March 6, 2026 20:00
@elena-shostak elena-shostak marked this pull request as ready for review March 6, 2026 20:01
@elena-shostak elena-shostak requested review from a team as code owners March 6, 2026 20:01
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-security (Team:Security)

@azasypkin
Copy link
Copy Markdown
Contributor

ACK: Sorry for the delay, will finish review today.

Copy link
Copy Markdown
Contributor

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a few questions and suggestions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, seems there is no easy way to do that, it has different type claim, but it doesn't help us much

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roger that, thanks for checking!

Comment on lines 200 to 208
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, looks good to me, thanks 👍

@elasticmachine
Copy link
Copy Markdown
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] Agent Builder API Smoke Tests #1 / Agent Builder - LLM Smoke tests EIS Models (dynamically configured) Connector: google-gemini-3.1-pro can continue a text conversation
  • [job] [logs] Jest Tests #6 / discover responsive sidebar should render buttons in data view picker correctly
  • [job] [logs] Jest Tests #11 / Security Plugin start() exposes proper contract
  • [job] [logs] Jest Tests #11 / Security Plugin start() exposes proper contract

History

@elena-shostak elena-shostak merged commit 6b45ad7 into elastic:main Mar 31, 2026
18 checks passed
mbondyra added a commit to mbondyra/kibana that referenced this pull request Mar 31, 2026
…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)
  ...
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
## 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__
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
## 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__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants