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
9
votes
1 answer

How to overwrite Spring Cloud OAuth2 client autoconfiguration?

We want to setup a microservice which provides a REST API so it is configured as a OAuth2 resource server. This service should also act as a OAuth2 client with the client credential grant. Here is the…
9
votes
1 answer

Spring OAuth: Resource Server with Authorization Server backend

I want to develop two independent services, one for the business stuff and one for the user authentication using Spring OAuth 2 Let's call them Business-Service and OAuth-Service. Now I want the Business-Service delegate to the OAuth-Service if a…
9
votes
1 answer

OAuth2 SSO for multiple resource servers with spring boot and jHipster

So, I have an oAuth2 app which is jHipster app (using mongodb). I want to connect 3 resource apps to that app but all of them should share the same user base, so that the users should be able to login only once. Is there a way to configure multiple…
9
votes
1 answer

jhipster oauth : How can i get the access_token via CURL

i'm trying to use the jhipster tool in order to create a new project with the oauth2 authentication. The project example work fine, i can login with the angularjs interface, but can't understand how can i create a new user and then get the access…
9
votes
1 answer

Spring security oauth2: get username in REST webservice

I've created a RESTful web services to execute actions on a workflow. The web service is secured with oauth2 with my own authorization server. I want to add information to my workflow about who executed an action on it. What I can't figure out is…
Xymon
  • 225
  • 1
  • 3
  • 8
8
votes
1 answer

Resolving OAuth2AuthorizedClient as a Spring bean

I have a controller that is autowired with many services. These services are HTTP restful calls that retrieve data from various data sources, but these services are protected with OAuth2.0. I am trying to use Spring Security to implement a…
Justin Chao
  • 173
  • 1
  • 8
8
votes
0 answers

How use Spring Boot oAuth2 + Azure AD in a stateless micro-service?

When I try the sample code from Microsoft Azure to use oAuth2 and Spring Boot, it uses a stateful session to check authentication/authorization. You can see this in that: It never passes any headers/JWT on any calls It has a cookie "JSESSIONID"…
Don Rhummy
  • 24,730
  • 42
  • 175
  • 330
8
votes
2 answers

Spring Boot Data JPA @CreatedBy and @UpdatedBy not populating with authenticating with OIDC

I would like to get Spring JPA auditing to work with Spring Boot,I am authenticating with Keycloak using the latest feature of Spring Security. springBootVersion = '2.1.0.RC1' I am following the sample by spring security team…
Chirdeep Tomar
  • 4,281
  • 8
  • 37
  • 66
8
votes
0 answers

Spring Zuul Gateway Swagger-UI For All Micro-services

(I'm sorry if I'm not making any sense, it's pretty late and I just can't seem to find an answer) We're using spring boot microservices, with a netflix zuul gateway, and we'd like to access all the endpoint listings there. We have swagger-ui set up…
8
votes
4 answers

Spring Boot OAuth2 provider database tables explained

I am trying to implement an OAuth2 server with JWT and Spring Boot 2. There are some good examples on the internet, like this or this. They are using some database tables (oauth_client_details, oauth_client_token, oauth_code, oauth_approvals,…
8
votes
2 answers

Understanding spring-security-oauth2 @EnableAuthorizationServer

I have a spring-security-oauth2 project running smoothly with a class as Authorization server. The client-ids, user-tokens, refresh-tokens are all managed by the database. @Configuration @EnableAuthorizationServer public class…
Abdullah Khan
  • 12,010
  • 6
  • 65
  • 78
8
votes
1 answer

Spring Boot Oauth2 Extending DefaultTokenServices

I have an OAuth2 implementation that is working fine for the grant type = password. Now I need to add a logic of restricting the same user/password combination to be allowed to login again if the user is logged in earlier. For that, I researched and…
i_raqz
  • 2,919
  • 10
  • 51
  • 87
8
votes
1 answer

spring-security-oauth2 JwkTokenStore with custom user details service

I've a rich web (react based) front end application that sends request to a backend ResourceServer application. The requests are sent with JWT in the header for authentication. My setup does authentication against an Okta Authorization Server and…
8
votes
2 answers

How to tie OAuth authentication with Spring Security

I have a Grails 2.5.3 app that currently uses spring security plugin for authentication. Users login using a username/pwd. I have updated the app now to support OAuth authentication (Using ScribeJava). Users can click a link that redirects them to…
Anthony
  • 33,838
  • 42
  • 169
  • 278
8
votes
1 answer

Spring Boot OAuth2 not working properly on version 1.4.1

I was using Spring Boot 1.4.0 with Spring OAuth2. When I requested a token, the server response was: { "access_token": "93f8693a-22d2-4139-a4ea-d787f2630f04", "token_type": "bearer", "refresh_token": "2800ea24-bb4a-4a01-ba87-2d114c1a2235", …
Gabriel
  • 952
  • 10
  • 31