Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API created User cannot change profile settings #186272

Closed
Alphayeeeet opened this issue Jun 17, 2024 · 9 comments
Closed

API created User cannot change profile settings #186272

Alphayeeeet opened this issue Jun 17, 2024 · 9 comments
Labels
bug Fixes for quality problems that affect the customer experience Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!

Comments

@Alphayeeeet
Copy link

Kibana version:
8.14.0

Elasticsearch version:
8.14.0

Server OS version:
RHEL 8

Browser version:
current Chrome/Edge

Browser OS version:
Windows 11

Original install method (e.g. download page, yum, from source, etc.):
download page RPM

Describe the bug:
Users who were created using the Elasticsearch create/update users API cannot change their profile settings. There should be a separate Kibana API to initialize those saved object data. Then when the users are created using the UI, they can change their profile settings.

Steps to reproduce:

  1. Create a User using Users API
  2. Try to change profile settings

Expected behavior:
Users created by the Users API should be able to change their profile settings.

Screenshots (if relevant):
Standard User:
image

API created user:
image

Any additional context:
Reference: #185949

@Alphayeeeet Alphayeeeet added the bug Fixes for quality problems that affect the customer experience label Jun 17, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Jun 17, 2024
@Alphayeeeet
Copy link
Author

Alphayeeeet commented Jun 17, 2024

Unfortunately there is no API in Kibana which can be used to create the users.

@dmlemeshko
Copy link
Member

Hey @Alphayeeeet

Security API allows not only to create a user, but also update it:

Assuming you created a user my_test_user

PUT /_security/user/my_test_user
{
  "roles" : [ "viewer" ],
  "full_name" : "Alphayeeeet",
  "email" : "[email protected]",
}

Docs link

But since elastic user is reserved one, you won't be able to change full name / email. It is expected behaviour, for reserved ones only password can be changed.

Let me know if you still have questions

@Alphayeeeet
Copy link
Author

Yeah I know. But when I create users with the API from Elasticsearch, they cannot change profile settings like dark mode, which are saved in Kibana saved objects not user metadata.

Please try to reproduce first.

@jughosta jughosta added the Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! label Jun 17, 2024
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Jun 17, 2024
@SiddharthMantri
Copy link
Contributor

Hi @Alphayeeeet, can you please share the full request made to the ES API for creating users? We'd also like to know how are the newly created users then logging in?

@Alphayeeeet
Copy link
Author

The Users are logging in via Basic Auth over a Reverse Proxy. They use Authorization Header Basic for each request. I will provide The request ASAP but it should be a regular POST to the ES users api with Fullname, Username, Email and Password in the Body.

@SiddharthMantri
Copy link
Contributor

SiddharthMantri commented Jun 19, 2024

Hey @Alphayeeeet, thank you for the clarification.

Unfortunately, authenticating users over a proxy is a limitation we currently have. For such scenarios, we are unable to create sessions and hence activate profiles for these users. This in turn causes side effects like being unable to save profile changes

There's a lot more context here - specifically under the header: Interactive users (authenticating via HTTP proxy) .

We've got an issue to track this here: #158277

@Alphayeeeet
Copy link
Author

@SiddharthMantri Thank you for the update. Thats very unfortunate. I hope support for proxy is provided soon, as it is a limitation for our users.

The ES-API request would be like this:

POST /_security/user/jacknich
{
"password" : "l0ng-r4nd0m-p@ssw0rd",
"roles" : [ "admin", "other_role1" ],
"full_name" : "Jack Nicholson",
"email" : "[email protected]",
"metadata" : {
"script_managed": true
}
}

@Alphayeeeet
Copy link
Author

@SiddharthMantri You can close this ticket with reference to the other, as there is already #158277 to track this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
Development

No branches or pull requests

5 participants