Questions tagged [userdetailsservice]

60 questions
7
votes
3 answers

Spring boot 2+ Could not Autowire. There is more than one bean of 'UserDetailsService'

Hello Everyone i'm new in spring security and jwt. I'm implementing Jwt in my spring boot project to secure user login and i'm using spring boot 2.1.5 and i don't know much about new bean restriction in spring boot 2+ . I need some help .. here…
6
votes
3 answers

Spring Boot Oauth2 Resource Server UserDetailsService

Trying to get a UserDetailsService working for an oauth2 resource server I set up. I'm able to successfully authenticate the jwt, but nothing I do seems to get it to call the loadUserByUsername method. This originally was using SAML and it was…
6
votes
3 answers

Spring Boot OAuth 2.0 UserDetails user not found

I am new to Spring Boot, and I am trying to configure OAuth 2.0. The problem I am having at this moment is that I keep getting the following message when I attempt to request for an access token: { "error": "invalid_grant", …
5
votes
1 answer

Custom Spring UserDetailsService not called

I'm trying to add some custom data for currently logged in user, so I found that I can implement my own UserDetailsService and just plug it in Spring, but it's never called, I always get Principal as just username string. I have my implementation of…
4
votes
0 answers

Spring Security: How can I access SessionRegistry inside custom UserDetailsService?

I am getting the following error message Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.security.core.session.SessionRegistry] found for dependency: expected at least 1…
natskvi
  • 125
  • 2
  • 9
3
votes
2 answers
3
votes
1 answer

Spring-Security oauth2 create custom oauth_client_details table

i want to implement oauth2 in my Spring REST application. Firstly, i have implemented my custom authentication and userdetails (with my own roles and authorities). That works fine with basic authentication. Tables: user: user_id, name, email,…
3
votes
1 answer

Spring security always giving me bad credentials exception

I am configuring spring security with annotation Version 4.0.2 Here is my SpringSecurityConfig public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private AuthenticationSuccessHandler successHandler; …
Ravi Kumar
  • 993
  • 1
  • 12
  • 37
3
votes
0 answers

After submit login form request goes to get Access Denied spring security

I am facing a weird problem, When I write it works fine but I change it to it goes directly to 403 page. Here is my…
2
votes
0 answers

WebSecurityConfigurerAdapter and UserDetailsService creating circular dependency

My two following classes are creating a circular dependency @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { private ApplicationUserServiceImpl applicationUserServiceImpl; private…
2
votes
2 answers

How to register multiple UserDetailsService on a authenticationManagerBuilder

I have two different repository for normal user and admin and separate url endpoints to authenticate. I want the authentication manager to use separate UserDetailsService for the endpoints since both normal and admin users can have same username and…
2
votes
1 answer

Default admin user in config and other users from database

I'm using spring boot with spring security and jpa. I would like to have admin user in config and other users in database. The problem is when I added UserDetailsService, the admin user from application.properties stop…
Seldo97
  • 611
  • 1
  • 8
  • 17
2
votes
1 answer

User Roles Spring Data Rest Spring security

I have an error that I dont really understand. I didn't find any tutorial that explain why it doesn't work. I have this spring boot application using spring security. When I make this POST request : http://localhost:8181/roles body: { …
2
votes
2 answers

SpringBoot UserDetailsService loadUserByUsername Method Never Called with custom WebSecurityConfigurerAdapter

I'm following the tutorial in this video: https://www.youtube.com/watch?v=X80nJ5T7YpE&list=PLqq-6Pq4lTTYTEooakHchTGglSvkZAjnE&index=12 My code is at the state of the 7:30 mark. For whatever reason, I can't seem to get the SecurityConfigurer.java…
Will
  • 71
  • 8
2
votes
1 answer

Spring JDBC Authentication vs LoadUserByName Differences

Im new on spring security and I had some research on authentication ,I saw two options there are some guys posted.First one Jdbc authentication or In memory authentication ,and there are also loadUserByName(UserDetailService). what is difference…
Mithat Konuk
  • 447
  • 5
  • 19
1
2 3 4