spring-security-oauth2

Spring Oauth2 Authentication AWS behind Zuul

我的梦境 提交于 2019-12-11 01:29:57
问题 I have a problem/question. I have a "typical" spring cloud netflix environment at aws running. Now to my problem: Given (working authentication): Request (https: //DOMAIN.net/) -> AWS Load balancer (adds headers X-Forwarded-For and X-Forwarded-Proto) -> Zuul The route / for zuul is secured this means spring security correctly redirects the user to https: //DOMAIN/login and this triggers the correct redirect to our auth server with the correct redirect URI. No problem here. Given (not working

How can I revoke a JWT token?

我们两清 提交于 2019-12-11 01:13:52
问题 I am using Spring Security OAuth2 and JWT tokens. My question is: How can I revoke a JWT token? As mentioned here http://projects.spring.io/spring-security-oauth/docs/oauth2.html, revocation is done by refresh token. But it does not seem to work. 回答1: In general the easiest answer would be to say that you cannot revoke a JWT token, but that's simply not true . The honest answer is that the cost of supporting JWT revocation is sufficiently big for not being worth most of the times or plainly

spring-boot 1.3.0.RC1 : ClassCastException in getting oauth2 user info from session persisted in Redis

橙三吉。 提交于 2019-12-11 01:07:51
问题 I'm working with a spring-boot application having OAuth2 single sign-on (in development, but already working). and I changed session-store from Tomcat to Redis. Problem I got ClassCastException when I try to get my User object from SecurityContextHolder . Storing User object to UsernamePasswordAuthenticationToken @Service @Transactional public class MyTokenService implements ResourceServerTokenServices { @Setter private OAuth2RestOperations restTemplate; @Autowired ResourceServerProperties

How to get google user email to whitelist users when authenticating using Spring Boot OAuth2 against Google

若如初见. 提交于 2019-12-11 00:43:21
问题 I want to whitelist users connecting to my OAuth2 client, and I can't figure out how to get the user name (specifically the Google email address). I created a Spring Boot OAuth2 application based on a Spring Tutorial https://spring.io/guides/tutorials/spring-boot-oauth2/#_social_login_manual I'm authenticating against Google (successfully). I want to determine the user email address so I can whitelist authenticating users. This website, http://www.baeldung.com/spring-security-openid-connect

Using spring-security-oauth2 Authorization Server with kid and JWKS?

梦想与她 提交于 2019-12-10 19:44:22
问题 Following the documentation here and there, I managed to setup an Authorization Server that gives out JWT access tokens signed with asymmetric key, which are verified locally by a Resource Server using a local copy of the public key. So far so good. My final goal is for Resource Servers to use the JWKS endpoint on the Authorization Server, and use the 'kid' header in the JWT to lookup the right key in the JWKS and verify locally, supporting key rotation. I've found how to make the

Rest service with oauth2: Failed to find access token for token

▼魔方 西西 提交于 2019-12-10 19:17:34
问题 I try to create spring rest service, whis is autenticated by my own oauth2 resources server. I created resource server: @Configuration @EnableResourceServer protected static class ResourceServer extends ResourceServerConfigurerAdapter { @Autowired private TokenStore tokenStore; @Override public void configure(ResourceServerSecurityConfigurer resources) throws Exception { resources.tokenStore(tokenStore).resourceId("mobileapp"); } @Override public void configure(HttpSecurity http) throws

User Registration & Login | SSO using Spring Security OAuth 2.0

淺唱寂寞╮ 提交于 2019-12-10 19:06:46
问题 I am trying to implement user registration and log in flow | SSO using Spring Security Oauth 2.0 and Google as the authentication provider. How should I initiate registration and login flow? What filter needs to be applied? In registration flow, I will needs user's details (name, email) that are part of successful authorization response, to be persisted in my local database. How do I handle that? What's the purpose of oauth2:client id="oauth2ClientFilter" ? This is how my application context

Spring OAuth2 ClientId passed in as username for password grant type

孤街醉人 提交于 2019-12-10 18:53:35
问题 I am attempting a very basic implementation of the Spring OAuth2 library; however, when I send a request off to the server I receive the following error: { "error": "invalid_client", "error_description": "Bad client credentials" } When doing further debugging, I notice that for some reason the clientId is being passed in as the username within the resource owner flow. I have included my XML configuration and am curious if anyone could tell me if anything seems inherently wrong or if anyone

Spring OAuth/JWT get extra information from access token

拜拜、爱过 提交于 2019-12-10 17:47:42
问题 I made a simple application that use spring security with oauth/jwt provider. I added extra information in jwt token by custom JwtAccessTokenConverter and it works well. My issue is how gets these extra informations in my Rest Controller. This is my test: @RequestMapping(value = "/test", produces = { "application/json" },method = RequestMethod.GET) public String testMethod(OAuth2Authentication authentication, OAuth2AccessToken token, Principal user){ ..... Object a=token

spring security oauth2 java config - Handler dispatch failed; nested exception is java.lang.StackOverflowError

独自空忆成欢 提交于 2019-12-10 15:36:56
问题 Configured Spring Security with OAuth2 in java config, And client_credentails flow is working fine, but password flow is throwing Handler dispatch failed; nested exception is java.lang.StackOverflowError below is the log information 2016-10-10 23:19:08 DEBUG o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - Resolving exception from handler [public org.springframework.http.ResponseEntity<org.springframework.security.oauth2.common.OAuth2AccessToken> org.springframework.security.oauth2.provider