【发布时间】:2016-04-22 19:12:10
【问题描述】:
我正在实现 Authenticator 类并使用 AuthenticationFlowContext。当我通过 HTTPS 引用服务器时,在 context.getUriInfo().getAbsolutePath() 中仍然留下 http://{hostname}/auth/... 。
public void authenticate(AuthenticationFlowContext context) {
String url = context.getUriInfo().getAbsolutePath()+"?client_id="+context.getClientSession().getClient().getClientId()
+"&redirect_uri="+context.getClientSession().getNote("redirect_uri")
+"&state="+context.getClientSession().getNote("state")
+"&response_type="+context.getClientSession().getNote("response_type");
try {
url = URLEncoder.encode(url, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
context.forceChallenge(Response.seeOther(URI.create(idpUrl+"idp/l?lvl=2&url="+url)).build());
}
【问题讨论】:
标签: keycloak