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
0 answers

Migration to Spring Boot (Security) 2 from 1.x

In a current migration of a project from Spring boot 1.X to 2.0.9 I am facing a hard time with the Spring Security module. In a first step I have to change the properties to access the datasources (to jdbc-url) and now that part seems to be working…
breo
  • 23
  • 3
1
vote
1 answer

Getting Unauthorised Full authentication is required to access this resource in Oauth2 Spring Boot

I am using Oauth2 in Spring Boot and I am using JDBC token store to store the JWT tokens. This is my AuthorizationServerConfig @Configuration @EnableAuthorizationServer public class AuthorizationServerConfig extends…
1
vote
2 answers

How to set the access token once during the instanciation of the webClient in spring webflux?

I try to use WebClient with oauth2 in spring webflux. I fetch a token from an url access token and i set it into the webclient. but i do not like to fetch this access token in every call of other secured endpoints. Means that i want to fetch it only…
1
vote
0 answers

Spring Security and OneLogin Token Expiration

I am trying to configure an authentication flow in Spring Boot using OneLogin SSO. I can successfully authenticate, create a JWT token, and redirect to my frontend app. However, I am not certain of the next steps. When my JWT token expires, is the…
1
vote
1 answer

OAuth2, Access /oauth2/token ressource behind a proxy

I need to consume an API securised by OAuth2 with WebClient. I have configure the OAuth2AuthorizedClientManager to manage the access token and refresh it when it need to be. However I encounter some issue, java.net.UnknownHostException. There is a…
1
vote
0 answers

Spring Security 5.2.1 OAuth2 with XING not working

I have set up OAuth2 with Spring Security for my localhost test application with Azure Facebook GitHub Google Now I tried to do the same with Xing https://dev.xing.com/docs/authentication (OAuth2). spring: security: oauth2: client: …
Nabor
  • 1,661
  • 3
  • 20
  • 45
1
vote
1 answer

Spring Security - permit only requests with prefix

I need to secure all rest endpoints in our Resource Server except endpoints that start with /unsecured. So requests like the following should be permitted to everyone: /unsecured/foo/bar /unsecured ... but requests like…
1
vote
2 answers

Spring exchange google access token for user info

I am trying to implement google authentication for my website, it is React front end and Spring Boot REST back end. For my React app I've found a library that provides a Google Login button, in which I can specify 'client-id' of my app, registered…
1
vote
3 answers

Oauth2 - java.lang.IllegalStateException: UserDetailsService is required. with refresh token

I am trying to implement oauth2 with a jwt in spring boot and the autentication works but when I want to get the refresh_token an error occurs that indicates the following ... java.lang.IllegalStateException: UserDetailsService is required. …
Mickey
  • 173
  • 2
  • 11
1
vote
0 answers

Oauth2 With Maven Works But Gradle Does not

I have tried to develop Oauth and got the example from Oauth DZone. It is in maven. I have gradle build containing of following dependencies. I am using spring boot 1.5.9 compile('org.springframework.boot:spring-boot-starter') …
1
vote
2 answers

Cannot access to unsecured endpoints in Spring Boot

In my controller I have two endpoints where one is secured and one is public: @GetMapping("/public") public String getPublic() { return "public"; } @PreAuthorize("hasRole('USER')") @GetMapping("/private") public String getPrivate() { return…
Denis Stephanov
  • 4,563
  • 24
  • 78
  • 174
1
vote
1 answer

How can I get the OAuth2AccessToken with Spring-Boot?

I am using Spring-Boot and Spring Security with an OAuth2 login from a third party. The SSO provider has an accesstoken end point which returns the following JSON { "access_token": "CGjok", "refresh_token": "TSHO6E", "scope": "openid…
1
vote
1 answer

How to update data on Principal object on Spring Boot

I'm building a REST API with Spring Boot and OAuth2 and I'm facing with troubles when trying to update the Principal object on a session. I need to do this when updating the user because some relations on the database could change and I think it's…
Mellao
  • 116
  • 1
  • 10
1
vote
1 answer

Idiomatic way to register custom Authentication in Spring Security

My use case is that I'm using Spring Security 5.2's Oauth2 login, but would like my database user class to be available alongside the Oauth2AuthenticationToken within the Authentication. This is so that I have my database user class cached by the…
Nate Vaughan
  • 3,471
  • 4
  • 29
  • 47
1
vote
1 answer

Spring Boot - What event fired during Oauth2 authorization success

I have a spring boot app that uses oauth2 for authentication. I want to add an event listener to this and perform some custom action. I am unable to figure out what event is fired during the auth success in oauth2. Is it AuthenticationSuccessEvent?
Killer Beast
  • 469
  • 6
  • 21