Skip to content

[authn] Introduced error for empty login attempt#237611

Merged
elena-shostak merged 9 commits intoelastic:mainfrom
elena-shostak:236579-login-attempt-empty
Oct 8, 2025
Merged

[authn] Introduced error for empty login attempt#237611
elena-shostak merged 9 commits intoelastic:mainfrom
elena-shostak:236579-login-attempt-empty

Conversation

@elena-shostak
Copy link
Contributor

@elena-shostak elena-shostak commented Oct 6, 2025

Summary

Issue is coming from the value being undefined in the attempt. Added a separate error for empty login attempt with saml/oidc providers.

How to test

Run node scripts/functional_tests_server --config=x-pack/platform/test/security_functional/oidc.config.ts

and make a request

curl --location 'http://localhost:5620/internal/security/login' \
--header 'x-elastic-internal-origin: kibana' \
--header 'Kbn-Xsrf: true' \
--header 'Content-Type: text/plain' \
--data '{
    "providerType": "OIDC",
    "providerName": "oidc1",
    "currentURL": "http://localhost:5620/login?next=%2F"
}'

Refer to #236579 (comment) for debug details

Checklist

  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Closes: #236579

Release Note

Introduced a separate error for empty login attempt with saml/oidc providers.

Comment on lines +156 to +161
if (
!attempt?.value &&
[OIDCAuthenticationProvider.type, SAMLAuthenticationProvider.type].includes(
providerType as string
)
) {
Copy link
Contributor Author

@elena-shostak elena-shostak Oct 7, 2025

Choose a reason for hiding this comment

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

Important

For anonymous login empty attempt.value is a legitimate case, so check for saml/oidc provider is needed

@elena-shostak elena-shostak added Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// Feature:Security/Authentication Platform Security - Authentication bug Fixes for quality problems that affect the customer experience backport:skip This PR does not require backporting release_note:fix labels Oct 7, 2025
@elena-shostak elena-shostak marked this pull request as ready for review October 7, 2025 10:13
@elena-shostak elena-shostak requested a review from a team as a code owner October 7, 2025 10:13
@elasticmachine
Copy link
Contributor

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

@kc13greiner kc13greiner self-requested a review October 7, 2025 12:28
Copy link
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.

One question/nit - but PR LGTM!

@elena-shostak elena-shostak enabled auto-merge (squash) October 8, 2025 08:51
@elena-shostak elena-shostak merged commit 13a876e into elastic:main Oct 8, 2025
12 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

ymao1 pushed a commit to ymao1/kibana that referenced this pull request Oct 8, 2025
## Summary

Issue is coming from the `value` being `undefined` in the
[attempt](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/security/server/routes/authentication/common.ts).
Added a separate error for empty login attempt with saml/oidc providers.


## How to test

Run `node scripts/functional_tests_server
--config=x-pack/platform/test/security_functional/oidc.config.ts`

and make a request
```bash
curl --location 'http://localhost:5620/internal/security/login' \
--header 'x-elastic-internal-origin: kibana' \
--header 'Kbn-Xsrf: true' \
--header 'Content-Type: text/plain' \
--data '{
    "providerType": "OIDC",
    "providerName": "oidc1",
    "currentURL": "http://localhost:5620/login?next=%2F"
}'
```

Refer to
elastic#236579 (comment)
for debug details


### Checklist

- [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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

__Closes: https://github.com/elastic/kibana/issues/236579__

### Release Note
Introduced a separate error for empty login attempt with `saml/oidc`
providers.
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
## Summary

Issue is coming from the `value` being `undefined` in the
[attempt](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/security/server/routes/authentication/common.ts).
Added a separate error for empty login attempt with saml/oidc providers.


## How to test

Run `node scripts/functional_tests_server
--config=x-pack/platform/test/security_functional/oidc.config.ts`

and make a request
```bash
curl --location 'http://localhost:5620/internal/security/login' \
--header 'x-elastic-internal-origin: kibana' \
--header 'Kbn-Xsrf: true' \
--header 'Content-Type: text/plain' \
--data '{
    "providerType": "OIDC",
    "providerName": "oidc1",
    "currentURL": "http://localhost:5620/login?next=%2F"
}'
```

Refer to
elastic#236579 (comment)
for debug details


### Checklist

- [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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

__Closes: https://github.com/elastic/kibana/issues/236579__

### Release Note
Introduced a separate error for empty login attempt with `saml/oidc`
providers.
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Oct 27, 2025
## Summary

Issue is coming from the `value` being `undefined` in the
[attempt](https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/security/server/routes/authentication/common.ts).
Added a separate error for empty login attempt with saml/oidc providers.


## How to test

Run `node scripts/functional_tests_server
--config=x-pack/platform/test/security_functional/oidc.config.ts`

and make a request
```bash
curl --location 'http://localhost:5620/internal/security/login' \
--header 'x-elastic-internal-origin: kibana' \
--header 'Kbn-Xsrf: true' \
--header 'Content-Type: text/plain' \
--data '{
    "providerType": "OIDC",
    "providerName": "oidc1",
    "currentURL": "http://localhost:5620/login?next=%2F"
}'
```

Refer to
elastic#236579 (comment)
for debug details


### Checklist

- [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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

__Closes: https://github.com/elastic/kibana/issues/236579__

### Release Note
Introduced a separate error for empty login attempt with `saml/oidc`
providers.
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 bug Fixes for quality problems that affect the customer experience Feature:Security/Authentication Platform Security - Authentication release_note:fix Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// v9.3.0

4 participants