-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Allow UserBuilder to easily build a user without any authorities #12533
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
Comments
Thanks, @philwebb! Because it's allowed using the workaround, I agree it probably should be the default. I'm not aware of anything in the framework that would prevent this change or make it seem like a bad idea, but it's possible I'm simply missing it. Hopefully not. 😉 |
Sure @SaiUpadhyayula! I'll assign to you. (I will mention that I may take some time to run this change past other team members before anything is merged.) |
Thanks @stillya. Please note that it's always best to reach out prior to working on an issue for this very reason. @SaiUpadhyayula had you already started? If not, would you be interested in taking another one? |
@sjohnr Fine for me I can check other issues. |
Expected Behavior
When using the
org.springframework.security.core.userdetails.User.builder()
it should be easy to create a new user without any authorities:Current Behavior
The above fails with:
Context
The above error makes creating a user a little more difficult than it could be. As a workaround you can do:
I think that
UserBuilder.authorities
should default to an emptyList
.The text was updated successfully, but these errors were encountered: