minor fix
This commit is contained in:
parent
bc216b142f
commit
b8f1f23d1c
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue