minor fix

This commit is contained in:
DOHA 2016-03-01 19:56:42 +02:00
parent bc216b142f
commit b8f1f23d1c
2 changed files with 7 additions and 1 deletions

View File

@ -51,16 +51,21 @@ public class OAuth2AuthorizationServerConfig extends AuthorizationServerConfigur
.authorizedGrantTypes("implicit") .authorizedGrantTypes("implicit")
.scopes("read","write","foo","bar") .scopes("read","write","foo","bar")
.autoApprove(false) .autoApprove(false)
.accessTokenValiditySeconds(3600)
.and() .and()
.withClient("fooClientIdPassword") .withClient("fooClientIdPassword")
.secret("secret") .secret("secret")
.authorizedGrantTypes("password","authorization_code", "refresh_token") .authorizedGrantTypes("password","authorization_code", "refresh_token")
.scopes("foo","read","write") .scopes("foo","read","write")
.accessTokenValiditySeconds(3600) // 1hour
.refreshTokenValiditySeconds(2592000) // 30days
.and() .and()
.withClient("barClientIdPassword") .withClient("barClientIdPassword")
.secret("secret") .secret("secret")
.authorizedGrantTypes("password","authorization_code", "refresh_token") .authorizedGrantTypes("password","authorization_code", "refresh_token")
.scopes("bar","read","write") .scopes("bar","read","write")
.accessTokenValiditySeconds(3600) // 1hour
.refreshTokenValiditySeconds(2592000) // 30days
; ;
// @formatter:on // @formatter:on

View File

@ -37,7 +37,8 @@ public class CustomPostZuulFilter extends ZuulFilter {
final String refreshToken = json.get("refresh_token").getTextValue(); final String refreshToken = json.get("refresh_token").getTextValue();
final Cookie cookie = new Cookie("refreshToken", refreshToken); final Cookie cookie = new Cookie("refreshToken", refreshToken);
cookie.setHttpOnly(true); cookie.setHttpOnly(true);
// cookie.setPath(ctx.getRequest().getContextPath() + "/refreshToken"); // cookie.setSecure(true);
cookie.setPath(ctx.getRequest().getContextPath() + "/oauth/token");
cookie.setMaxAge(2592000); // 30 days cookie.setMaxAge(2592000); // 30 days
ctx.getResponse().addCookie(cookie); ctx.getResponse().addCookie(cookie);