Official tutorial: https://spring.io/guides/tutorials/spring-boot-oauth2/
Questions tagged [spring-oauth2]
708 questions
3
votes
2 answers
JWT with Spring OAuth2
I have created the Spring Authorization Server which issues JWT-s and a Resource Server which checks the JWT, its claims and permissions on the Authorization Server. To do so, I have followed this article.
My question is why I need to send the…

dplesa
- 1,355
- 6
- 23
- 56
3
votes
3 answers
PermitAll not working in Spring Security
I have two rules, the first one every url from oauth/** should be without security and and other url have to security. But now all urls are secure include url from oauth/**.
This is my security config rule.
@EnableWebSecurity
public class…

Demon Hunter
- 81
- 1
- 5
3
votes
1 answer
Issue JWT tokens from Spring OAuth2 Authorization Server when authenticating with Google
I want to create an authorization server using Spring Oauth which is able to issue it's own JWT tokens. The authorization server must delegate the authentication to Google. I have been following this tutorial which does almost everything I want:…

Nikola Kolev
- 1,239
- 3
- 17
- 25
3
votes
1 answer
spring oauth2 authorization code flow , configuration for VK (Vkontakte)
I'm using social network Vkontakte as Oauth2 authorization server. So I have several steps:
1) get code with request with request_type=code
2) get accessToken when I send request to access token uri
So I want to use Spring Oauth2, but I should get…

Sergii Getman
- 3,845
- 5
- 34
- 50
3
votes
2 answers
Spring OAuth2 redirect when Token expired
I am struggling to do this simple thing in Spring: Redirecting to the Login page when the access token expires.
I have:
a Edge Server (Zuul) for routing.
a OAuth2 authorization / authentication server.
a Resource Server that serves static…

LauRiot
- 31
- 1
- 5
3
votes
1 answer
Changing Json return format of Spring OAuth2
while consolidating our json responses, I tried to change the spring oauth2 json response to our format.
From
{
"error": "invalid_token",
"error_description": "Invalid access token: undefined"
}
To
{
"status" : 401,
"error_code":…

Otto
- 430
- 6
- 10
3
votes
1 answer
Client secret + refreshing the access token in spring oauth2
I am using spring boot for backend and Android device for frontend of my system.
Right now I am facing the challenge to use Spring-OAuth2 to secure my resource server.
I have some questions, which I want to discuss with you:
My knowledge + this…

FilipR
- 1,218
- 4
- 22
- 39
3
votes
1 answer
Spring Boot OAuth2 with basic authentication and custom UserDetailsService
I'm trying to configure an OAuth2 server that will be capable to complete the basic OAuth2 flows (see here for examples).
Apologies for the long question
My first attempt is to be able to perform an authorization_code flow.
I have the following…

tbo
- 9,398
- 8
- 40
- 51
3
votes
2 answers
Cannot inject LoadBalanced annotated OAuth2RestTemplate
I am using Spring Cloud Angel.SR4. My Configuration class for creating an OAuth2RestTemplate bean is as follows:
@Configuration
public class OAuthClientConfiguration {
@Autowired
private MyClientCredentialsResourceDetails resource;
…

Armin Balalaie
- 591
- 1
- 5
- 17
2
votes
1 answer
Spring Security Oauth2 login with custom authentication
I am using spring boot 3 and spring security 6.
My goal is to implement a login functionality that works with JWT tokens. The login page should have two options:
Custom login/register form
Login with Google (OAuth2 login)
The custom authentication…

Samet Baskıcı
- 1,090
- 3
- 13
- 26
2
votes
1 answer
Spring security - using WebClient access a resource that is protected via Oauth2 "Password" grant type
How can I access with WebClient a resource that is protected via the Oauth2 'Password' grant type?
Connecting with Oauth2 'client-credentials' works. In this case I need the password grant type.
I get this error:
401 Unauthorized from GET…

tm1701
- 7,307
- 17
- 79
- 168
2
votes
0 answers
Refresh token functionality in Spring cloud Gateway
I've setup a project in which I use Spring Cloud Gateway with oauth2 with authorization code flow functionalities and Keycloak as authorization server. The problem is that refresh token functionality is not working (I'm expecting it should be…

Giovanni Cannarile
- 36
- 3
2
votes
0 answers
OAuth2 Spring security with Google login doesn't work
I found a really good tutorial on third-party login with Spring security in the link below,
It contains both front-end and back-end code.
https://www.callicoder.com/spring-boot-security-oauth2-social-login-part-1/
Github :…

Akhil
- 59
- 1
- 11
2
votes
2 answers
Calling spring authorization server OAuth2 REST endpoints
Trying to implement the OAuth2 protocol using Spring Authorization Server. Created a simple application with the following configuration.
@SpringBootApplication
class AuthorizationServerApplication
fun main(args: Array) {
…

GROX13
- 4,605
- 4
- 27
- 41
2
votes
0 answers
Cannot prevent Multiple sessions for same user in spring security + redis
I am using spring security 5.6.0 with spring session data redis 2.6.0, spring boot 2.6.1.
I am trying to prevent concurrent logins for the same user. But it does not logs out the previous login instance. Basically I can have two sessions in two…

Umang Desai
- 43
- 4