spring-oauth2

Spring Boot 2 OIDC (OAuth2) client / resource server not propagating the access token in the WebClient

偶尔善良 提交于 2020-05-29 11:51:40
问题 Sample project available on Github I have successfully configured two Spring Boot 2 application2 as client/resource servers against Keycloak and SSO between them is fine. Besides, I am testing authenticated REST calls to one another, propagating the access token as an Authorization: Bearer ACCESS_TOKEN header. After starting Keycloak and the applications I access either http://localhost:8181/resource-server1 or http://localhost:8282/resource-server-2 and authenticate in the Keycloak login

Spring Boot Oauth2 use multiple grant_types for for same URL

青春壹個敷衍的年華 提交于 2020-05-12 07:49:08
问题 Is it possible to configure Spring Boot to allow Oauth2 grant types password and authorization_code on the same URL. For example /boot I have done basic authorization configuration as below security: oauth2: client: accessTokenUri: http://UAA/oauth/token userAuthorizationUri: http://UAA/oauth/authorize clientId: ****** clientSecret: ****** resource: userInfoUri: http://UAA/userinfo However all endpoints protected by this configuration use form login and redirect to UAA authorization URL even

App domains must match the domain of the Facebook Web Games URL (https), Mobile Site URL, Unity Binary URL, Site URL or Secure Page Tab URL

偶尔善良 提交于 2020-05-10 06:54:58
问题 I am developing Spring Boot + Facebook Integration example. In this example, I've created an at app https://developers.facebook.com/. The screen shot of the created app shown below. Also when I was passing the Domain name I am getting the below error: App domains must match the domain of the Facebook Web Games URL (https), Mobile Site URL, Unity Binary URL, Site URL or Secure Page Tab URL. Please correct these domains: localhost I am using the same code mentioned in the URL blocked: This

How to make API Gateway Stateless for Authentication/Authorization Process Using Oauth2?

僤鯓⒐⒋嵵緔 提交于 2020-04-30 05:48:07
问题 In my design I have an API gateway (spring cloud api gateway), authorization server (Oauth2) and a resource server (microservice). (I have also a CAS server but now it can be ignored for simplicity) I just want to use API gateway to redirect client requests. If the user is not authenticated, request should be sent to authorization server and after authentication and authorization process is finished, authorization server should return JSESSION and JWT in access_token header. After that API

How to make API Gateway Stateless for Authentication/Authorization Process Using Oauth2?

北城以北 提交于 2020-04-30 05:48:05
问题 In my design I have an API gateway (spring cloud api gateway), authorization server (Oauth2) and a resource server (microservice). (I have also a CAS server but now it can be ignored for simplicity) I just want to use API gateway to redirect client requests. If the user is not authenticated, request should be sent to authorization server and after authentication and authorization process is finished, authorization server should return JSESSION and JWT in access_token header. After that API

EnableResourceServer breaks oAuth2 authorization server

巧了我就是萌 提交于 2020-03-16 07:12:26
问题 I implemented oAuth2 authorization server using Spring Boot version 1.5.2.RELEASE. The authorization server supports implicit flow. With the WebSecurityConfig below the login form (http://localhost:8200/login) works well. @Configuration public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private JpaUserDetailsService userDetailsService; @Bean @Override public UserDetailsService userDetailsServiceBean() throws Exception { return userDetailsService; } @Bean public

How to logout oauth2 client in Spring?

风流意气都作罢 提交于 2020-02-27 04:36:12
问题 I have the simplest oauth2 client: @EnableAutoConfiguration @Configuration @EnableOAuth2Sso @RestController public class ClientApplication { @RequestMapping("/") public String home(Principal user, HttpServletRequest request, HttpServletResponse response) throws ServletException { return "Hello " + user.getName(); } public static void main(String[] args) { new SpringApplicationBuilder(ClientApplication.class) .properties("spring.config.name=application").run(args); } } I also have the

Spring Security HttpSecurity config

落花浮王杯 提交于 2020-01-24 17:06:05
问题 I try to understand how the RequestMatcher, AntMatcher and so on are working. I read some posts and understand the basics. Actually I have this simple basic config: @Override protected void configure(HttpSecurity http) throws Exception { http.requestMatchers() //1 .antMatchers("/login", "/oauth/authorize") //2 .and() //3 .authorizeRequests() //4 .anyRequest() //5 .authenticated() //6; I really dont understand the points 1,2 and 3. From my understanding this means requests of /login and /oauth

User based permissions/scopes in Spring oAuth2

蓝咒 提交于 2020-01-24 13:13:07
问题 In my current setup I have standalone spring oAuth2 server, standalone resource server and angularJs app with reverse proxy. On the authentication server side I have register 2 clients (web-app and internal client for service communication). I correctly receive client scopes and Users roles. Question 1 I need different permission (e.g. scopes) per user not client (web-app, mobile,...) I tried providing my own ClientsDetailService where I would build ClientDetails for each user, but only thing

JWE in Spring Security OAuth2 JWT

﹥>﹥吖頭↗ 提交于 2020-01-14 09:29:18
问题 Is it possible to use JSON Web Encryption(JWE) with Spring Security OAuth2 JWT ? Right now I have a following JwtAccessTokenConverter : @Bean public JwtAccessTokenConverter accessTokenConverter() { JwtAccessTokenConverter converter = new JwtAccessTokenConverter() { @Override public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) { DBUserDetails user = (DBUserDetails) authentication.getUserAuthentication().getPrincipal(); final Map<String, Object>