Advertisement
Guest User

Untitled

a guest
Jan 12th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. git clone https://github.com/ArnaudDenoyelle/sscce-spring-oauth2.git
  2.  
  3. mvn spring-boot:run
  4.  
  5. http://localhost:9999/uaa/oauth/authorize?response_type=code&client_id=acme&redirect_uri=http://example.com
  6.  
  7. -user : user
  8. -password : password
  9.  
  10. @SpringBootApplication
  11. public class AuthserverApplication extends WebMvcConfigurerAdapter {
  12.  
  13. public static void main(String[] args) {
  14. SpringApplication.run(AuthserverApplication.class, args);
  15. }
  16.  
  17. @Configuration
  18. @EnableAuthorizationServer
  19. protected static class OAuth2Config extends AuthorizationServerConfigurerAdapter {
  20.  
  21. @Autowired
  22. private AuthenticationManager authenticationManager;
  23.  
  24. @Override
  25. public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
  26. endpoints.authenticationManager(authenticationManager);
  27. }
  28.  
  29. @Override
  30. public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
  31. clients.inMemory()
  32. .withClient("acme")
  33. .secret("acmesecret")
  34. .authorizedGrantTypes("authorization_code", "refresh_token", "password").scopes("openid");
  35. }
  36.  
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement