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