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")
.scopes("read","write","foo","bar")
.autoApprove(false)
.accessTokenValiditySeconds(3600)
.and()
.withClient("fooClientIdPassword")
.secret("secret")
.authorizedGrantTypes("password","authorization_code", "refresh_token")
.scopes("foo","read","write")
.accessTokenValiditySeconds(3600) // 1hour
.refreshTokenValiditySeconds(2592000) // 30days
.and()
.withClient("barClientIdPassword")
.secret("secret")
.authorizedGrantTypes("password","authorization_code", "refresh_token")
.scopes("bar","read","write")
.accessTokenValiditySeconds(3600) // 1hour
.refreshTokenValiditySeconds(2592000) // 30days
;
// @formatter:on

View File

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