Questions tagged [spring-security-oauth2]

Spring Security's deprecated implementation of the OAuth2 spec. For OAuth2 with Spring Security 5 use Spring Security tag. We don't get many questions on OAuth 1(a) but feel free to tag them here.

Spring Security's deprecated implementation of the OAuth2 spec. The GitHub Project and the Spring Framework Website provide support for using Spring Security 4 with OAuth (1a) and OAuth2. It provides features for implementing both consumers and providers of these protocols using standard Spring and Spring Security programming models and configuration idioms.

3166 questions
13
votes
5 answers

The bean 'dataSource', defined in BeanDefinition defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$H

I'm using Spring Boot Security OAuth2 example by taking reference from https://www.devglan.com/spring-security/spring-boot-security-oauth2-example. In this example, I'm suing Spring Boot Parent version 2.1.1.RELEASE and spring-cloud-dependencies is…
PAA
  • 1
  • 46
  • 174
  • 282
13
votes
4 answers

Cannot instantiate interface org.springframework.context.ApplicationListener after adding spring-security-oauth2

After I added spring-security-oauth2 to my pom.xml: org.springframework.security.oauth spring-security-oauth2 2.2.0.RELEASE I started to get…
Stefan Falk
  • 23,898
  • 50
  • 191
  • 378
13
votes
1 answer

CSRF issue with Spring + Angular 2 + Oauth2 + CORS

I am developing a client-server application based on Spring 4.3 and Angular (TypeScript) 4.3, in a CORS scenario where, in production, server and client are on different domains. Client ask for REST server APIs via http requests. 1. REST AND OAUTH…
13
votes
3 answers

Spring Security OAuth - Provider Manager is Not Configured for Null Resource

Am trying to use Spring Secruity's OAuth API to obtain an access token from an externally published API. This curl command works (and its contents are all that I need to obtain an access token): curl -X POST \ https://api.app.com/v1/oauth/token \ …
PacificNW_Lover
  • 4,746
  • 31
  • 90
  • 144
13
votes
4 answers

Spring Boot: Oauth2: Access is denied (user is anonymous); redirecting to authentication entry point

I am trying to use spring boot oauth2 to accomplish stateless authentication and authorisation. However, I am struggling to it working. Here is my…
cosmos
  • 2,143
  • 2
  • 17
  • 27
13
votes
2 answers

Spring Oauth2.0 Missing grant type

I am using Spring Oauth 2.O. When I pass request as a form-data it works fine, but when I try to pass data in application/json format it gives me error missing grant…
Parth Solanki
  • 3,268
  • 2
  • 22
  • 41
13
votes
2 answers

Authorization header not passed by ZuulProxy starting with Brixton.RC1

In switching from Spring Cloud Brixton.M5 to Brixton.RC1 my ZuulProxy no longer passes Authorization headers downstream to my proxied services. There's various actors in play in my setup, but most all of them are fairly simple: -…
Tim
  • 19,793
  • 8
  • 70
  • 95
13
votes
5 answers

StackOverflowError in spring oauth2 with custom ClientDetailsService

I made my own implementation of ClientDetailsService: @Service public class JpaClientDetailsService implements ClientDetailsService { @Autowired private ClientRepository clientRepositoy; @Override public ClientDetails…
Arnaud
  • 742
  • 7
  • 23
13
votes
1 answer

Spring OAuth2 not giving refresh token

I am running a OAuth Provider using Spring and "password" grant type. Running this (provider is on port 8080): curl -u "app:appclientsecret" "http://localhost:8080/oauth/token" --data…
13
votes
2 answers

How to add filter after the HTTP BasicAuthenticationFilter when using @EnableAuthorizationServer

I am trying to go over the following documentation: https://github.com/spring-projects/spring-security-oauth/blob/f25592e682303b0cf89e1d7555174bac18e174df/docs/oauth2.md#mapping-user-roles-to-scopes In the documentation, it says in order to map…
Ali Moghadam
  • 1,270
  • 8
  • 17
12
votes
2 answers

Spring Security 5 populating authorities based on JWT claims

As I see Spring Security OAuth2.x project was moved to Spring Security 5.2.x. I try to implement authorization and resource server in new way. Everythin is working correctly except one thing - @PreAuthorize annotation. When I try to use this with…
ketrab321
  • 541
  • 2
  • 12
  • 22
12
votes
1 answer

Spring Security 5 OAuth2 WebClient [client_authorization_required] Authorization required for Client Registration Id: dummies"

I am trying to implement a simples example following this: https://www.youtube.com/watch?v=1N-xwmoN83w&t=1653s and this: https://github.com/jzheaux/messaging-app I am running a local OAuth2 Server using spring boot (@EnableAuthorizationServer) and I…
12
votes
4 answers

Spring OAuth2: DuplicateKeyException when using JdbcTokenStore and DefaultTokenServices under heavy load

As mentioned in the title, I'm experiencing the issue, when the same client is querying the token endpoint concurrently (two processes requesting token for the same client at the same time). The message in the logs of the auth server looks like…
12
votes
4 answers

Spring Security and Action Required after login

I'm trying to implement an action required screen after user is logged-in in Spring Security? I have a requirement where user has to perform to complete a form (change password, accept Terms Of Use, etc.), then once user completes that action he can…
Maksim
  • 16,635
  • 27
  • 94
  • 135
12
votes
1 answer

How to configure Resource Server in Spring Security for it to use additional information in JWT token

I have an oauth2 jwt token server configured to set additional info about the user authorities. @Configuration @Component public class CustomTokenEnhancer extends JwtAccessTokenConverter { CustomTokenEnhancer(){ super(); } …
aksinghdce
  • 193
  • 1
  • 12