Questions tagged [userdetailsservice]

60 questions
0
votes
1 answer

Spring Security Circular Dependency User Details

I am developing a Spring Boot application. I have to make credentials for both Admins users. I was Working on Spring Security . Struck with circular dependency error. Without including spring security I tested other urls with post api. It worked…
0
votes
1 answer

Spring Security returns 401 for registered users

I'm trying to build a simple Spring Security app that registers users and has 1 endpoint that should be available to authenticated users. The registration goes successful, but when I try to access the /auth EP with the registered user basic auth, I…
Saiker
  • 11
  • 2
0
votes
0 answers

How to update user details if logged in user updated his/her email or phone number spring boot?

How to update logged in user details and refresh username through which he/she can log in again with updated email or contact number as username. Currently, if I update email as a user then, after update, throwing me an exception of user not found…
Rakhi
  • 81
  • 4
  • 21
0
votes
1 answer

Remember me button for login and BCrypt for passwords in Spring Boot 2.6.X and possibly Spring Boot 3

I made a very simple application in Spring Boot. I have used very few features offered by the framework and despite everything I have problems updating my application to the most recent versions of the framework. I also note that the support for…
0
votes
1 answer

Add additional user requirements in spring security login and handle various exceptions

I am new to Spring security, I have implemented a basic user login functionality for my app using JWT. Aside from checking for username and password at login I would like to add other parameters such as a "account is verified" boolean condition but…
0
votes
0 answers

Spring Security Jwt: getAuthorities() method of custom userDetails class returns no values(roles)

So, I have two different types of users, a User entity that has a role of USER and a HOST entity that has a role of HOST, and roles have permissions accordingly. I created a UserPrincipal that implements UserDetails where i override the…
0
votes
0 answers

How to properly implement validated registration in the database?

The same "springboot.model.User.setUsername(String)" because "users" is null" error is constantly coming out. The error is clear, it says that you cannot set null. I send json data to the DTO class, where I check if it is in the database and if it…
Daniel Vai
  • 71
  • 8
0
votes
3 answers

Testing login api Spring Security with Postman

I am Working on a spring boot project for an e-commerce website, As a beginner, I try to add spring security in it so the problem is when I try to test my rest login API using postman I have a status code 200 and the body is always the default login…
0
votes
1 answer

How to add PasswordEncoder into JdbcUserDetailsManager in Spring Security?

I'm learning about Spring Security and I want to add the BCryptPasswordEncoder at the JdbcUserDetailsManager. This is the code: @Configuration @EnableWebSecurity public class DemoSecurityConfig extends WebSecurityConfigurerAdapter { @Bean …
user9608350
0
votes
1 answer

How UserDetails from UserDetailsService compare data passed via user in html form

I have: @Service public class MyAppUserDetailsService implements UserDetailsService { @Autowired private IUserInfoDAO userInfoDAO; @Override public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException { User…
0
votes
2 answers

Autowiring is null in Custom Authentication Provider

I'm facing a serious problem and I can't figure out how to solve it. Basically, in my Custom Authentication provider, I can't autowire my customUserDetailsService, it is returning a null pointer exception. I'm gonna paste all the classes I'm using…
0
votes
1 answer

Springboot authentication with an additional custom parameter

I’m trying to use spring boot security in my application. I need to give access to both sales men and customers. Each are mapped to different entities and in turn use different repositories. How can my UserDetailServive implementation use a…
Roberto Petrilli
  • 711
  • 1
  • 8
  • 22
0
votes
1 answer

Error creating a bean webSecurityConfig through unsatisfied dependency field userDetailsService

I am working on a spring-boot, shopping-cart application. Everything seems ok, the connection to mysql is working, JDBC is loaded, but i ll always get an exception, i can't find a solution on. It seems that the Interface UserDetailsService is not…
user6221709
0
votes
1 answer

userRepository insecure as userDetailsService needs to look up user

I have implemented a custom UserDetailsService that looks up a user and allows them to get a oauth 2 token using password grant. The service indicates to use a JPA userRepository to look up the user. This all works, except that now I have a /users…
0
votes
1 answer

UserServiceDetails of Spring Security doesn't work

I'm learning Spring4 by reading .And now, I met a problem about the Spring Security.When I request "/home", I get the login page, but when I fill the form and submit it, I can't go into the UserDetailsService but go the controller directly and then…