Official tutorial: https://spring.io/guides/tutorials/spring-boot-oauth2/
Questions tagged [spring-oauth2]
708 questions
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
11
votes
1 answer
Combining Oauth2 with formlogin and actuator security in Spring Boot
I am using Spring Boot 1.5.9 and have an application that has an API that uses OAuth2 client credentials, with formlogin for a CMS that uses Thymeleaf in the same Spring Boot application.
For this to work, I have the following bean to configure the…

Wim Deblauwe
- 25,113
- 20
- 133
- 211
11
votes
3 answers
OAuth2 flow from resource server to another
Implementation agnostic discussion.
Assume the following diagram.
Black lines show which services are protected by the auth server.
Green lines show interaction between services(Customer, and Orders services need to go through the Data service…

iocentos
- 263
- 4
- 12
11
votes
2 answers
How do I map OAuth 2 token to UserDetails object in a resource server?
I have 2 separate Spring Boot applications, one serving as an an OAuth 2 authorization server, and the other as resource server. I'm using Spring's RemoteTokenServices in my resource server to check tokens from the authorization server. Now, I'm…

Psycho Punch
- 6,418
- 9
- 53
- 86
11
votes
1 answer
TokenEndpoint : Handling Null Pointer Exception
I've tried requesting a code from my oauth2 server by executing this command through curl
curl -X POST -k -vu clientapp:123456 http://localhost:8080/oauth/token -H "Accept: application/json" -d…

user962206
- 15,637
- 61
- 177
- 270
11
votes
3 answers
How does Spring Oauth2 login redirect work?
I've been thrashing around with the Spring Boot Oauth2 tutorial and I can't seem to get a pretty key element working:
https://spring.io/guides/tutorials/spring-boot-oauth2/
I want to run as an authorization server. I've followed the instructions as…

Ryan
- 545
- 1
- 5
- 16
10
votes
3 answers
use spring cloud gateway with oauth2
i face a problem when i using spring cloud gateway
is if any dependency call spring-boot-starter-tomcat directly or recursively
it will not work because it will start the embedded tomcat server not the netty server that spring cloud gateway use…

ashraf revo
- 767
- 2
- 12
- 24
10
votes
2 answers
How to call JHipster (Spring) OAuth2 Rest server using Postman Authentication helpers
Postman has Authentication helpers to help with authenticated calls and I'm trying to use the OAuth 2.0 helper to call a REST server created by JHipster using Spring (Security, Social, etc).
I've tried a lot of configurations, this is the screen…

Denis C de Azevedo
- 6,276
- 2
- 32
- 49
9
votes
3 answers
An error occurred while attempting to decode the Jwt: Signed JWT rejected: Another algorithm expected, or no matching key(s) found
I am trying setup OAuth2-OpenID Connect with ForgeRock OpenAM integrated with spring security and am getting the following error
2019-06-17 15:01:42.576 DEBUG 62255 --- [nio-8090-exec-2] .o.s.r.w.BearerTokenAuthenticationFilter :
Authentication…

Adnan Mamajiwala
- 578
- 3
- 9
- 21
9
votes
4 answers
Refresh token call fails using spring security an oauth2 with error: UserDetailsService is required
I am using Spring Security OAuth2 for authorizations. When trying to refresh the token I get an error: UserDetailsService is required (interestingly I get this error only on unix machines and not on windows). I am using Spring OAuth2 version…

Filip Majernik
- 7,700
- 13
- 45
- 53
9
votes
2 answers
Authentication is required to obtain an access token (anonymous not allowed)
I try to modify existing example - Tonr2 and Sparklr2.
Also I viewed this tutorial based on Spring Boot Spring Boot OAuth2. I try to build application like in Tonr2 example but without first login (on tonr2). I just need one Authentication on…

Oleksandr H
- 2,965
- 10
- 40
- 58
9
votes
1 answer
Request 'OPTIONS /logout' doesn't match 'POST /logout
I am studying Spring Cloud and Spring OAuth2 by decomposing the three interconnected apps in this GitHub sample. When I open up the /oauth/revoke-token endpoint in the authserver app and then call it from the ui app with a…

CodeMed
- 9,527
- 70
- 212
- 364
9
votes
2 answers
Spring Oauth2 - reload principals
I have implemented OAuth2 password grant with spring security module. I add own implementation of UserDetails and UserDetailsService (jdbc). I inject User to my controllers with:
@AuthenticationPrincipal User user
where User is my implementation of…

IgorekPotworek
- 1,317
- 13
- 33
8
votes
2 answers
Is Oauth2.0 appropriate for first-party apps?
I am developing a SPA application in angular and I have a lot of confusion about the correct way to implement authentication and authorization.
First of all, the application is a first-party app, which means that I am developing both the…

Snake
- 113
- 1
- 9
8
votes
2 answers
Missing client_id when accessing token with linkedIn
I have extended spring security oauth example social-auth-server, linkedIn was added as third authentication option.
This project is described in tutorial Hosting an Authorization Server.
Source code:…

MariuszS
- 30,646
- 12
- 114
- 155