spring-oauth2

How to autowire this TokenStore

徘徊边缘 提交于 2019-12-07 00:30:10
问题 How do I trigger auto-logout of this sample Spring Boot OAuth2 app? I tried adding the following code from an answer to this other posting into a new controller class in the demo package of the authserver app: package demo; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.oauth2.common.OAuth2AccessToken; import org.springframework.security.oauth2.provider.token.TokenStore; import org

Spring Boot OAuth2 implicit flow + form login and Request method 'POST' not supported error

烂漫一生 提交于 2019-12-06 15:00:08
In my Spring Boot application I'm trying to configure OAuth2 implicit flow. For this purpose I'm trying to configure custom login form. This is my config: @Configuration public class WebMvcConfig extends WebMvcConfigurerAdapter { @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { configurer.enable(); } @Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/").setViewName("index"); registry.addViewController("/login").setViewName("login"); } @Override public void addResourceHandlers

spring oauth2 authorization code flow , configuration for VK (Vkontakte)

风流意气都作罢 提交于 2019-12-06 08:58:44
问题 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 authorization code first, then access token, i've tried to add to application.yml : authorized-grant-types: authorization_code it's my application.yml: security: oauth2: client: clientId: [clientId] clientSecret: [clientSecret] accessTokenUri: https

Spring OAuth2 XML configuration for Client and Resource Server [closed]

寵の児 提交于 2019-12-06 06:58:25
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . Can any one help me with a very basic configuration in XML to act my spring application as OAuth2/OIDC Resource serer and as well as cilent. What I have? A Spring Web MVC application with Spring Secuirity LDAP authentication. What I want to achieve? If user tries to access any

o.s.s.o.provider.endpoint.TokenEndpoint : “Handling error: IllegalStateException, This object has not been built”

北城以北 提交于 2019-12-06 06:50:07
问题 I am trying to implement Spring Boot Oauth2 using JDBC token store. When I use the following url: http://localhost:8080/oauth/token I am getting following output: { "error": "server_error", "error_description": "This object has not been built" } Please find below my concerned configuration classes: 1. AuthorizationServerConfig @Configuration @EnableAuthorizationServer public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter { public static final String CHECK_TOKEN

How to autowire this TokenStore

♀尐吖头ヾ 提交于 2019-12-05 05:49:23
How do I trigger auto-logout of this sample Spring Boot OAuth2 app ? I tried adding the following code from an answer to this other posting into a new controller class in the demo package of the authserver app : package demo; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.oauth2.common.OAuth2AccessToken; import org.springframework.security.oauth2.provider.token.TokenStore; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org

spring boot OAuth2 role based authorization

江枫思渺然 提交于 2019-12-05 04:51:11
We have a dedicated authorization server extending AuthorizationServerConfigurerAdapter, where we have set authorities overriding void configure(ClientDetailsServiceConfigurer clients) method. @Configuration @EnableAuthorizationServer protected static class OAuth2Config extends AuthorizationServerConfigurerAdapter { @Value('${oauth.clientId}') private String clientId @Value('${oauth.secret:}') private String secret @Value('${oauth.resourceId}') private String resourceId @Autowired @Qualifier('authenticationManagerBean') private AuthenticationManager authenticationManager @Bean public

Using WebSecurityConfigurerAdapter with Spring OAuth2 and user-info-uri

点点圈 提交于 2019-12-04 16:57:50
I have created an Authorization service as follows @SpringBootApplication @EnableAuthorizationServer public class AuthorizationApplication { ... } With this application.properties . server.port=9000 security.oauth2.client.client-id=monederobingo security.oauth2.client.client-secret=monederobingosecret security.oauth2.client.authorized-grant-types=authorization_code,refresh_token,password,client_credentials security.oauth2.client.scope=company,client Then, in a separate spring boot project I have created a Resource Server. @SpringBootApplication @EnableResourceServer public class App { ... }

Spring OAuth2 XML configuration for Client and Resource Server [closed]

只谈情不闲聊 提交于 2019-12-04 14:33:34
Closed . This question needs to be more focused. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed last year . Can any one help me with a very basic configuration in XML to act my spring application as OAuth2/OIDC Resource serer and as well as cilent. What I have? A Spring Web MVC application with Spring Secuirity LDAP authentication. What I want to achieve? If user tries to access any resource(e.g. index.html) in my application, he should be asked for his credentials(can be

spring oauth2 authorization code flow , configuration for VK (Vkontakte)

喜欢而已 提交于 2019-12-04 12:19:41
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 authorization code first, then access token, i've tried to add to application.yml : authorized-grant-types: authorization_code it's my application.yml: security: oauth2: client: clientId: [clientId] clientSecret: [clientSecret] accessTokenUri: https://oauth.vk.com/access_token userAuthorizationUri: https://oauth.vk.com/authorize tokenName: access