Skip to content

feat(security,uiam): support both ES native and UIAM session tokens when in UIAM mode#245063

Merged
azasypkin merged 3 commits intoelastic:mainfrom
azasypkin:issue-xxx-uiam-saml-both-native-and-uiam-tokens
Dec 5, 2025
Merged

feat(security,uiam): support both ES native and UIAM session tokens when in UIAM mode#245063
azasypkin merged 3 commits intoelastic:mainfrom
azasypkin:issue-xxx-uiam-saml-both-native-and-uiam-tokens

Conversation

@azasypkin
Copy link
Copy Markdown
Contributor

Summary

During the transitional period and staged rollout, Kibana needs to be able to handle sessions using either UIAM or ES native access and refresh tokens, even when UIAM mode is enabled in Kibana. To achieve this, in addition to checking the UIAM configuration, Kibana also checks whether the access token returned by the Elasticsearch SAML realm starts with the well-known UIAM token prefix: essu_.

How to test

UIAM mode with UIAM tokens

Start both ES and Kibana in UIAM mode and check if you can log in.

$ yarn es serverless --projectType security --uiam
$ yarn start --serverless=security --uiam

UIAM mode with ES native tokens

Start only Kibana in UIAM mode and check if you can log in.

$ yarn es serverless --projectType security
$ yarn start --serverless=security --uiam

/cc @slobodanadamovic

@azasypkin azasypkin self-assigned this Dec 3, 2025
@azasypkin azasypkin added Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Dec 3, 2025
@azasypkin azasypkin force-pushed the issue-xxx-uiam-saml-both-native-and-uiam-tokens branch from 2beb71a to 5d080c1 Compare December 3, 2025 14:59
@azasypkin azasypkin marked this pull request as ready for review December 3, 2025 18:21
@azasypkin azasypkin requested a review from a team as a code owner December 3, 2025 18:21
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@kc13greiner kc13greiner self-requested a review December 3, 2025 18:36
@azasypkin azasypkin force-pushed the issue-xxx-uiam-saml-both-native-and-uiam-tokens branch from 5d080c1 to e8c40af Compare December 4, 2025 18:47
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #13 / Serverless Common UI - Examples data view field editor example "before all" hook in "data view field editor example"

Metrics [docs]

✅ unchanged

History

cc @azasypkin

Copy link
Copy Markdown
Contributor

@kc13greiner kc13greiner left a comment

Choose a reason for hiding this comment

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

Works great - LGTM!

* transition period while we support both SAML and UIAM tokens at the same time.
* @param token ES native or UIAM access or refresh token.
*/
private isUiamToken(token?: string): this is { options: { uiam: UiamServicePublic } } {
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.

this is

😲

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.

Yeah, it might be handy, although I wanted TypeScript to also force token!, but it can only deal with either the type of the arguments or this, not both.

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.

This comment was a TIL/amazed, I've never seen this before; very cool!

@azasypkin azasypkin enabled auto-merge (squash) December 5, 2025 10:05
@azasypkin azasypkin merged commit e53b802 into elastic:main Dec 5, 2025
13 checks passed
@azasypkin azasypkin deleted the issue-xxx-uiam-saml-both-native-and-uiam-tokens branch December 5, 2025 12:18
wildemat pushed a commit to wildemat/kibana that referenced this pull request Dec 5, 2025
…hen in UIAM mode (elastic#245063)

## Summary

During the transitional period and staged rollout, Kibana needs to be
able to handle sessions using **either** UIAM or ES native access and
refresh tokens, even when UIAM mode is enabled in Kibana. To achieve
this, in addition to checking the UIAM configuration, Kibana also checks
whether the access token returned by the Elasticsearch SAML realm starts
with the well-known UIAM token prefix: `essu_`.

## How to test

### UIAM mode with UIAM tokens
Start both ES and Kibana in UIAM mode and check if you can log in.
```bash
$ yarn es serverless --projectType security --uiam
$ yarn start --serverless=security --uiam
```

### UIAM mode with ES native tokens
Start only Kibana in UIAM mode and check if you can log in.
```bash
$ yarn es serverless --projectType security
$ yarn start --serverless=security --uiam
```

/cc @slobodanadamovic
JordanSh pushed a commit to JordanSh/kibana that referenced this pull request Dec 9, 2025
…hen in UIAM mode (elastic#245063)

## Summary

During the transitional period and staged rollout, Kibana needs to be
able to handle sessions using **either** UIAM or ES native access and
refresh tokens, even when UIAM mode is enabled in Kibana. To achieve
this, in addition to checking the UIAM configuration, Kibana also checks
whether the access token returned by the Elasticsearch SAML realm starts
with the well-known UIAM token prefix: `essu_`.

## How to test

### UIAM mode with UIAM tokens
Start both ES and Kibana in UIAM mode and check if you can log in.
```bash
$ yarn es serverless --projectType security --uiam
$ yarn start --serverless=security --uiam
```

### UIAM mode with ES native tokens
Start only Kibana in UIAM mode and check if you can log in.
```bash
$ yarn es serverless --projectType security
$ yarn start --serverless=security --uiam
```

/cc @slobodanadamovic
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.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants