簡體   English   中英

使用自定義用戶注冊表登錄失敗的根本原因在WebSphere(Liberty)中調用哪個API?

[英]Which API to call in WebSphere (Liberty) for root cause of failure of login using custom user registry?

WebSphere(傳統) :如果使用custom user registry基於容器的身份驗證,當從Web應用程序登錄失敗時,我們通過調用以下內容找到失敗的根本原因:

com.ibm.websphere.security.auth.WSSubject.getRootLoginException();

以上API存在於:{Server_Root_Dir} /AppServer/plugins/com.ibm.ws.runtime_x.yzjar

getRootLoginException()方法的反編譯源代碼是:

public static Throwable getRootLoginException(){
   return ContextManagerFactory.getInstance().getRootException();
}

WebSphere(Liberty) :如果使用custom user registry基於容器的身份驗證,我們無法通過調用以下內容找到登錄失敗的根本原因:

com.ibm.websphere.security.auth.WSSubject.getRootLoginException();

以上API存在於:{Server_Root_Dir} /lib/com.ibm.websphere.security_x.yzjar

這是因為方法getRootLoginException()的反編譯源代碼是:

public static Throwable getRootLoginException(){
   return null;
}

但是在https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.javadoc.doc/web/apidocs/com/ibm/websphere/security/auth/WSSubject.html

IBM聲稱:

public static java.lang.Throwable getRootLoginException()

這個方便的方法返回系統登錄模塊中捕獲的根登錄異常(如果存在)。

它將從當前線程中提取異常。 您將獲得登錄模塊視為根異常的內容。 這可能是嵌套異常。 您可能需要從返回的異常中提取異常,直到獲得真正的根異常。

返回:包含根登錄異常的Throwable。 如果未發生登錄異常,則返回null。

我想知道在WebSphere(Liberty)中調用哪個API,以便找到登錄失敗的根本原因。

為什么需要WSSubject.getRootLoginException():

com.ibm.websphere.security.UserRegistry的自定義實現要求您通過提供自己的checkPassword(String userSecurityName, String passwd)定義checkPassword(String userSecurityName, String passwd)驗證Web應用程序用戶輸入的用戶名和密碼。 請參閱http://www.ibm.com/support/knowledgecenter/en/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/csec_customauth.html

如果用戶提供的信息不正確,您可能會將PasswordCheckFailedExceptionCustomRegistryException與您的消息一起拋出。 這個checkPassword(String userSecurityName, String passwd)實際上是由WebSphere(傳統或Liberty)從JAAS javax.security.auth.spi.LoginModule.login()PasswordCheckFailedExceptionCustomRegistryException調用的,它們的消息被包裝並且javax.security.auth.login.LoginException拋出javax.security.auth.login.LoginException

為了向Web應用程序用戶提供反饋,我們需要掌握從javax.security.auth.spi.LoginModule.login()拋出的異常。 執行此操作的方法是從servlet過濾器調用com.ibm.websphere.security.auth.WSSubject.getRootLoginException() 這在WebSphere(傳統)中工作正常,但在WebSphere(Liberty)中不再適用。 問題是IBM沒有在任何地方記錄這個限制。

在傳統的WAS中,很久以前就將其解析為APAR PM21010 您可能希望提交PMR,特別是因為Brian發現這是在WebSphere Liberty Profile中記錄為受支持的API。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM