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
10
votes
2 answers

How to secure a MVC application with OAuth2 using Spring?

Sorry, my English. I have an application I can login in the usual way. @Configuration @EnableWebSecurity public class LoginSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void…
Magno C
  • 1,922
  • 4
  • 28
  • 53
10
votes
6 answers

Angular HttpClient doesn't send POST, it sends OPTIONS

Im' newbie using Angular HttpClient (and writting english too) I have a problem, I'm trying sending HTTP request with POST method in order to negociate OAuth token obtenction but angular sends OPTIONS request: Service: login(username: string,…
10
votes
1 answer

Spring OAuth 2 + JWT Inlcuding additional info JUST in access token

I am able to include additional information into the access token implementing my own TokenEnhancer, but such info is included twice. One in the encoded access_token, and the other in the auth server response. Long story short! I request an access…
alvgarvilla
  • 1,026
  • 12
  • 25
10
votes
1 answer

What is the use of JdbcApprovalStore(ApprovalStore) in spring-security-oauth?

I am using JWTTOkenStore in spring-security-oauth. The issue I am facing is I want to add support of revoking JWT token. I know there are other options to handle this but I am looking for this option. I found that we can use…
027
  • 1,553
  • 13
  • 23
10
votes
1 answer

Spring Security: hasAuthority is ignored when configured globally for HttpSecurity

I have a REST API on Spring MVC with OAuth2. In order to support expression handlers like hasRole and hasAuthority I've added the following config: @Configuration @EnableGlobalMethodSecurity(prePostEnabled = true) public class MethodSecurityConfig…
10
votes
5 answers

How to set proxy on spring oauth2 OAuth2AccessToken request or How to override OAuth2AccessTokenSupport restTemplate variable?

I have tried to set network proxy in the following ways, but none of the method is working 1: set jvm variables like -Dhttp.proxyHost= -Dhttp.proxyPort= ....... 2: Created the Bean. @Bean public RestTemplate restTemplate() { final String…
10
votes
3 answers

Need to create oAuth2 token manually without password

I have implemented oAuth2 with spring security and it is working fine for me. But Now I want to create user token from back-end manually without password. Because I have only username of user. Can any one help me.
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…
10
votes
3 answers

spring boot oauth2 with jdbc token store gives oauth_access_token relation doesn't exist

I am trying to integrate spring boot with OAuth2. I was able to get this to work with InMemoryStore for tokens by following this https://github.com/royclarkson/spring-rest-service-oauth. But when I try to implement it with JdbcTokenStore and a…
10
votes
2 answers

Spring Security Ouath2 : Extended UserDetails not returned by the Principal object

Last week I started on extending the UserDetails class to be able to support a custom field. The special thing about this field is that it gets filled with a value that depends an a request parameter. I managed to implement this correctly (so the…
Robin Hermans
  • 1,579
  • 1
  • 24
  • 52
10
votes
2 answers

How to register a custom BasicAuthenticationFilter AuthenticationProvider in Spring Boot using Spring Security OAuth2

Context I'm developing an application that allows an authenticated user to create OAuth2 bearer tokens for use with APIs published by the organization. The idea is to allow the user to self generate / revoke such tokens, similar to GitHub's Personal…
9
votes
2 answers

How to create custom claims in JWT using spring-authorization-server

I'm building an OAuth2 authorization server based on the experimental Spring project Spring Authorization Server My use case is quite simple, fetch users from a DB, and based on some properties of the user, set some custom claims in the JWT being…
9
votes
4 answers

ClientRegistrationRepository Bean is not found

I am trying to configure an OAuth2 client using Spring Boot. I have the following dependencies: org.springframework.boot spring-boot-starter-security
9
votes
2 answers

Replacement for UnAuthenticatedServerOAuth2AuthorizedClientRepository

We are using spring security oauth2 to obtain token using client credentials grant type. We are not using the application.properties file for specifying the client credentials, instead we are supplying them programmatically. ClientRegistration…
Ajeet Bansal
  • 91
  • 1
  • 2
9
votes
1 answer

User Roles in Amazon Cognito

I have a Jhipster application that is authenticated with the Amazon Cognito. The users that can access this application are those that dont have access to the AWS Resources therefore I moved with user pools instead of Identity pools. Please let me…
prashant s
  • 148
  • 1
  • 1
  • 9