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

Initial/default admin user cannot be accessed when using demo authentication type #6398

Closed
00Chaotic opened this issue Mar 1, 2024 · 4 comments · Fixed by #6808
Closed

Comments

@00Chaotic
Copy link
Contributor

Describe the feature request

Add an email field for the default/initial admin user created on startup so that the user can be accessed even when using the demo authentication type (which only uses email, not username or password).

Background

The configuration options mention that a default admin user is created on startup. If a custom username or password are specified, they will be used instead of the defaults.

When using the demo authentication type, only an email is required to sign in. However, as the admin user is only created with a username and password, and no email, this user cannot be accessed without going into the database and manually adding an email to the admin user.

This effectively means there is no way to perform actions that require admin permissions (including creating new users) without manually making changes to the admin user database record.

Solution suggestions

Adding an email to the default admin user and an email field to the existing initialAdminUser configuration options would allow for the admin user to be used in the demo authentication type.

@ivarconr
Copy link
Member

ivarconr commented Mar 1, 2024

yes it make sense to allow the admin user to be configured with an email.

That said: "Demo mode" is not an intended way to run Unleash for other things than small Demo/hackathons.

@00Chaotic
Copy link
Contributor Author

Thanks, while I don't entirely understand the infrastructure we have in place for our implementation of the Unleash server, I believe it's not publicly exposed and involves security mechanisms outside the application itself, so the demo mode is used as a simpler access method that does not require creating user accounts and managing permissions for users across multiple teams.

@ivarconr
Copy link
Member

ivarconr commented Mar 6, 2024

An alternative solution to the problem described inis to change the input form of demo-login to not require email if the user input is simply "admin".

@00Chaotic
Copy link
Contributor Author

An alternative solution to the problem described inis to change the input form of demo-login to not require email if the user input is simply "admin".

Linking the response to this that I've made in the PR

thomasheartman added a commit that referenced this issue Apr 23, 2024
This PR introduces a configuration option (`authentication.demoAllowAdminLogin`) that allows you to log in as admin when using demo authentication. To do this, use the username `admin`. 

## About the changes
The `admin` user currently cannot be accessed in `demo` authentication
mode, as the auth mode requires only an email to log in, and the admin
user is not created with an email. This change allows for logging in as
the admin user only if an `AUTH_DEMO_ALLOW_ADMIN_LOGIN` is set to `true`
(or the corresponding `authDemoAllowAdminLogin` config is enabled).

<!-- Does it close an issue? Multiple? -->
Closes #6398 

### Important files

[demo-authentication.ts](https://github.com/Unleash/unleash/compare/main...00Chaotic:unleash:feat/allow_admin_login_using_demo_auth?expand=1#diff-c166f00f0a8ca4425236b3bcba40a8a3bd07a98d067495a0a092eec26866c9f1R25)


## Discussion points
Can continue discussion of [this
comment](#6447 (comment))
in this PR.

---------

Co-authored-by: Thomas Heartman <[email protected]>
@github-project-automation github-project-automation bot moved this from Support rotation to Done in Issues and PRs Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants