0
我使用SSO登录我web-application.My代码,如下所示:ZK框架的SSO问题?
@Command("doSSOLogin")
@NotifyChange("showConflictWindow")
public void doSSOLogin(@ContextParam(ContextType.VIEW) Component view) {
logger.info("Login Button is clicked..");
doSSOLoginAuthorization(LoginType.LOGIN_IF_NO_CONFLICT);
}
private void doSSOLoginAuthorization(LoginType argLoginType) {
HttpServletResponse response = getHttpServletResponse();
HttpServletRequest request = getHttpServletRequest();
if (selectedDatabase == null) {
Messagebox.show("Must select a database", "Error", Messagebox.OK,
Messagebox.ERROR);
return;
}
String Authorization = request.getHeader("Authorization");
if (Authorization == null) {
logger.info("Authoriztion is null");
response.reset();
response.setHeader("WWW-Authenticate", "NEGOTIATE");
response.setContentLength(0);
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
response.setHeader("connectionCache", selectedDatabase.getValue());
response.setHeader("languageType", selectedLanguage.getValue());
try {
response.flushBuffer();
} catch (IOException e) {
e.printStackTrace();
}
return;
} else {
String token = Authorization.substring("NEGOTIATE ".length());
logger.info("Authoriztion is not null having token ::" + token);
if (token.startsWith("TlRM")) {
logger.debug("We do not support NTLM authentication: " + token);
System.out.println("We do not support NTLM authentication");
return;
}
}
}
当用户点击登录按钮它通过这个代码&第一次授权是null.So设置在授权请求标题并要求获得窗口凭证&第二次当我再次单击此按钮时,我获得授权。 但我不想再次点击按钮,这项工作应该单击完成,因为它已经在我以前的应用程序中工作,但技术是jsp。
是否在我的代码中使用ZK或其他东西的问题? 如果您有任何解决方案可以回电,请帮我解决。
先谢谢了!
感谢您的回复!这是为我工作,但我需要确切的解决方案,不是那么解决方案 – psisodia