Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jojozhai committed Sep 11, 2017
1 parent 2724e1c commit a96c733
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public class ImoocAuthorizationServerConfig extends AuthorizationServerConfigure

@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints.tokenStore(tokenStore).authenticationManager(authenticationManager)
endpoints.tokenStore(tokenStore)
.authenticationManager(authenticationManager)
.userDetailsService(userDetailsService);
}

Expand All @@ -49,8 +50,12 @@ public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
InMemoryClientDetailsServiceBuilder builder = clients.inMemory();
if (ArrayUtils.isNotEmpty(securityProperties.getOauth2().getClients())) {
for (OAuth2ClientProperties client : securityProperties.getOauth2().getClients()) {
builder.withClient(client.getClientId()).secret(client.getClientSecret())
.accessTokenValiditySeconds(client.getAccessTokenValidateSeconds());
builder.withClient(client.getClientId())
.secret(client.getClientSecret())
.authorizedGrantTypes("refresh_token", "authorization_code", "password")
.accessTokenValiditySeconds(client.getAccessTokenValidateSeconds())
.refreshTokenValiditySeconds(2592000)
.scopes("all");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ server.session.timeout = 600

#security.basic.enabled = false

server.port = 9090
server.port = 8060

#imooc.security.browser.loginPage = /demo-signIn.html
#imooc.security.browser.loginType = REDIRECT
Expand Down

0 comments on commit a96c733

Please sign in to comment.