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
1
vote
1 answer

Access Token not being fetched from Authorization Code in Spring Security Oauth2? Call for access token fails giving ERR_TOO_MANY_REDIRECTS?

I'm writing a spring-boot application which is an Oauth2 client, I'm using my Organization's Oauth server (custom written). I'm running into trouble while fetching the access token. Initially, the call for the authorization code works fine, the…
1
vote
1 answer

Cannot throw custom exception message for JWT CustomClaimVerifier

I'm trying to verify the claim inside the JWT token using JwtClaimsSetVerifier given by Spring Boot 2.1. The problem is that Spring always throws an exception with the default exception message: { "error": "invalid_token", …
1
vote
1 answer

Spring OAuth2 Client: I/O error on POST request for oauth2/v2.0/token

Im using spring oauth2 client against Azure AD - I have it working successfully on my localhost:8080 When I deploy this working OAuth2 Client code against Azure AD on remote server with https enabled https://serverhost.corp.com , I get an Auth Code…
1
vote
1 answer

Spring OAuth2 configuration flow. Do I need my own login controller to login user to provide resource-services access?

I use spring-boot 2 to configure my authorization. To make familiar readers with terms: OAuth2 server - trusted authorization server. One knows all registered clients and keeps under the control all tokens that was produced. client - any server that…
Sergii
  • 7,044
  • 14
  • 58
  • 116
1
vote
1 answer

Spring-Security-Oauth2.0: Is there a default oauth db schema which comes along with the library? How can we customize it?

I am learning about spring-security-oauth. I used the schema given here. I have Authorization server and resource server in same application. In Authorization server configuration, we tell which jdbc data-source to use, but where do we tell that…
Marvolo
  • 61
  • 2
  • 3
1
vote
0 answers

Spring OAuth2 XML configuration still giving errors about redirects and anonymous access

I've been trying to get Spring OAuth2 working with XML configuration. I have a fully (non Spring Boot) working application using Spring Security with the latest versions of libraries. I had Spring Social for Google configured and working prior to…
Jim Richards
  • 708
  • 1
  • 7
  • 19
1
vote
0 answers

Validate Access token in service to service authentication using azure oauth2

I want to enable service to service authentication in my services using spring boot and azure oauth2.I have generated access token using https://login.microsoftonline.com//oauth2/token (POST) I want to validate that whenever my service is hit with…
1
vote
1 answer

Need help Implementing OpenID connect/ OAuth2 flow using React-native, Spring Rest Api and ADFS 4.0

I have really hard time trying to understand mostly how should I implement my authorization flow. I think I have the authentication flow mostly correctly implemented using the technologies I've listed in the title. Here's what I want to…
1
vote
5 answers

Can't make a successful Authorization request from Axios request to Spring-security oauth2 backend

Hi I have this request in Postman. How do I make the same request in Reactjs axios? executeAuthenticationService(username, password) { return axios.get(`${API_URL}/oauth/token?grant_type=password&username=${username}&password=${password}`, …
Alvin
  • 136
  • 2
  • 5
  • 12
1
vote
0 answers

Spring OAuth2: Always returning invalid token

I am trying to implement an OAuth2-Server with one Resource Server using Spring Boot. I am able to request tokens but if I use them to request resources from the Resource server the result is always 'invalid token'. This is the authorization server…
ph_0
  • 617
  • 8
  • 27
1
vote
2 answers

How to add(overwrite) expiry time for oAuth2 access token in spring + java

I have a situation where the authorisation server is not returning expires_in field to the token response, but the token expires after certain time. Can I set this manually somewhere in my code ? Below is my code for ROPC. @Bean(name =…
1
vote
0 answers

How to add custom logic for authorizing and authentication in OAuth2.0 with Spring boot?

While authorizing and generating access token using OAuth 2.0 implemented with Spring boot.. we implement UserEntity with UserDetails in which we return respective fields from methods getUsername() and getPassword() which is gets called while…
1
vote
0 answers

How get a new token for every request in spring-boot oauth2 tokenstore

I am using oauth2 security in spring boot with 2.1.5 version. When I send a request to issue token, I am receiving an only the same token that got before. I cannot get a token until the token is expired. After that, I can get a new token, but again…
1
vote
0 answers

How to pass OAuth2Authentication in rest controller

I'm trying to get a token using rest controller and AuthorizationServerTokenServices. I want to send my OAuth2Authentication through my body: this is my request: POST /external/oauth/token HTTP/1.1 Host: localhost:9000 Authorization: Basic…
1
vote
1 answer

OAuth2AuthenticationToken not been recognized in getAccount JHipster 6.0.1

I have a native android client with OAuth2 authentication to my JHipster monolithic app. It worked properly with the JHipster version 5.7.2, but now I am using version 6.0.1 and I am not been able to get the current user by using…
J. Gatica
  • 153
  • 1
  • 10