| | |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.security.authentication.AuthenticationManager; |
| | | import org.springframework.security.core.userdetails.UserDetailsService; |
| | | import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer; |
| | | import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter; |
| | | import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer; |
| | |
| | | public class AuthorizationServerConfiguration extends AuthorizationServerConfigurerAdapter { |
| | | |
| | | private static String REALM = "MY_OAUTH_REALM"; |
| | | |
| | | @Autowired |
| | | private UserDetailsService userDetailsService; |
| | | |
| | | @Autowired |
| | | private TokenStore tokenStore; |
| | |
| | | |
| | | @Override |
| | | public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception { |
| | | endpoints.tokenStore(tokenStore).userApprovalHandler(userApprovalHandler).authenticationManager(authenticationManager); |
| | | endpoints.tokenStore(tokenStore) |
| | | .userApprovalHandler(userApprovalHandler) |
| | | .authenticationManager(authenticationManager) |
| | | .userDetailsService(userDetailsService); |
| | | } |
| | | |
| | | @Override |