Questions tagged [spring-oauth2]

Official tutorial: https://spring.io/guides/tutorials/spring-boot-oauth2/

708 questions
2
votes
1 answer

How to store OAuth2 session into database and share it between Spring Boot servers

I want to create a solution based on that tutorial: https://www.baeldung.com/rest-api-spring-oauth2-angular But it's not clear for me how several Spring Boot servers behind load balanced can share the same token session. With session cookie the…
Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
2
votes
0 answers

Validating Auth0 Bearer token returns malformed

I have a SPA and an API that trust each other and share the Auth0 client properties. I followed the example from https://auth0.com/docs/architecture-scenarios/spa-api . The SPA successfully logs in and sends Bearer access tokens for the API to check…
2dor
  • 851
  • 3
  • 15
  • 35
2
votes
0 answers

Spring Oauth2 returns 401 Unauthorized error with spring boot 2.0

I am trying to implement SSO with spring oauth2. For the spring 1.5.x, it works fine. However once i upgrade the oauth server app to spring boot 2.2.3.RELEASE, i even cannot go to login form. Going to "http://localhost:8082/" redirect…
2
votes
0 answers

How to get client app id at runtime on oauth2 server - spring boot

I am new to Spring boot and implementing oauth server where I want to use oauth2 authorization grant type flow. I have multiple clinet apps and each client app has its own ldap group to authenticate the user. I wonder how I can get client app id at…
2
votes
0 answers

Add Spring Sleuth to Spring Oauth2's requests

We have problem with propagation of traceId in requests which are called by spring oauth2 module. For instance consider authorization and resource server. In resource server we have spring security configuration to ensure get rsa public key from…
2
votes
2 answers

Add new field in Spring Boot Oauth2 response

I am crated a Spring Boot Oauth2 Authentication and worked fine. I need to add usertype field with Oauth2 response. My Code given below. @Configuration @EnableAuthorizationServer public class AuthorizationServerConfig extends…
Shahid Neermunda
  • 1,317
  • 1
  • 14
  • 28
2
votes
2 answers

oauth2ClientContext is not getting injected

The application is not starting as there are two candidate beans. I am getting the below error when starting the application. *************************** APPLICATION FAILED TO START *************************** Description: Parameter 0 of method…
zilcuanu
  • 3,451
  • 8
  • 52
  • 105
2
votes
0 answers

How to find the REST method that matches a request URI in Spring Boot within an interceptor?

To give you a background, we have an application with lots of REST services. Now for these services there are security permission entries. Now we could have an AccessVoter that intercepts all the request to check whether the user has permission to a…
xbmono
  • 2,084
  • 2
  • 30
  • 50
2
votes
2 answers

Authentication is required to obtain an access token - when using 'password' grant and Spring's ResourceOwnerPasswordResourceDetails

I am new to Spring Security and I want to implement a client for a OAUTH2 secured service that only accepts password grant. Obtaining the access_token from the auth server is done using data in the http body like…
2
votes
2 answers

Customization of TokenEndpoint in Sprin OAuth2

I would like to provide a custom implmentation of the TokenEndpoint class in Spring framework. Ive copied over the TokenEndpoint class of spring and have made my changes to the required places. But when the applications starts, I'm always getting…
2
votes
1 answer

Request HTTPS resource with OAuth2RestTemplate

I am trying to fetch some data from an API secured with SSL. I have configured my OAUth2RestTemplate with the necessary configuration but I am getting the following exception Caused by: org.springframework.web.client.ResourceAccessException: I/O…
Smajl
  • 7,555
  • 29
  • 108
  • 179
2
votes
3 answers

How to set connection timeout with OAuth2RestTemplate while fetching access token

We are able to fetch access token using attached code snapshot but didn't find any way to set connection timeout as we do with spring restTemplate.Is there any way to set a connection timeout with OAuth2RestTemplate.
H Kumar
  • 35
  • 2
  • 6
2
votes
2 answers

How do I enable multiple client ids in a Spring Boot OAuth2 Server?

I have Spring Boot OAuth2 server working, but now we need to distinguish between different clients from different departments and provide different functionality depending on the department. I figure I can separate it by the client id. This guide…
Chloe
  • 25,162
  • 40
  • 190
  • 357
2
votes
0 answers

How to Handle the RedirectMismatchException in Spring oAuth Server?

When working with Spring OAuth Server there is a redirect_uri request parameter which when does not match any of the registered URIs in a oauth client details database table causes the oauth server to throw a RedirectMismatchException. I cannot…
InterestedDev
  • 578
  • 7
  • 22
2
votes
1 answer

Why does my JdbcTokenStore store serialize Java objects?

So I am just moving from the InMemoryTokenStore to the JdbcTokenStore. As usual, one seemingly simple change is followed by a handful of side effects including swallowed exceptions - sorry for the rant. This is how I used to access the users'…
Stefan Falk
  • 23,898
  • 50
  • 191
  • 378