【问题标题】:WSO2IS NullPointerException when using step authenticator使用步骤验证器时出现 WSO2IS NullPointerException
【发布时间】:2016-02-15 13:41:55
【问题描述】:

有时(?)WSO2 IS 用户无法通过以下异常进行身份验证。重试时,用户将通过身份验证。任何想法可能是原因/解决方案?我们设置了会话缓存。

使用 WSO2 Identity Server 5.0.0.SP1 / SAML 身份验证,身份验证器设置为高级(单步,多个选项)。我找不到正确的源代码提交来签出(以匹配异常中的行号)

提前谢谢大家 加布里埃尔

TID: [0] [IS] [2016-02-15 13:07:22,914] 错误 {org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator} - 身份验证框架中的异常 {org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator} java.lang.NullPointerException 在 org.wso2.carbon.identity.application.authentication.framework.handler.sequence.impl.DefaultStepBasedSequenceHandler.handle(DefaultStepBasedSequenceHandler.java:83) 在 org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultAuthenticationRequestHandler.handle(DefaultAuthenticationRequestHandler.java:121) 在 org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator.handle(DefaultRequestCoordinator.java:94) 在 org.wso2.carbon.identity.application.authentication.framework.servlet.CommonAuthenticationServlet.doPost(CommonAuthenticationServlet.java:54) 在 org.wso2.carbon.identity.application.authentication.framework.servlet.CommonAuthenticationServlet.doGet(CommonAuthenticationServlet.java:44) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:735) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

编辑:

WSO2 IS 5.1.0 也出现此异常

参见Source code 第 105 行

StepConfig stepConfig = context.getSequenceConfig().getStepMap().get(currentStep);

// if the current step is completed
if (stepConfig.isCompleted()) {
   stepConfig.setCompleted(false);

ERROR org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator} -  Exception in Authentication Framework 
java.lang.NullPointerException
    at org.wso2.carbon.identity.application.authentication.framework.handler.sequence.impl.DefaultStepBasedSequenceHandler.handle(DefaultStepBasedSequenceHandler.java:105)
    at org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultAuthenticationRequestHandler.handle(DefaultAuthenticationRequestHandler.java:115)

看起来 stepConfig 从身份验证配置中“消失”了。设置在单个节点上完成,会话持久化到数据库中。

【问题讨论】:

  • 在此设置中是否进行了任何自定义?如果是,它们是什么?
  • 设置了“高级身份验证器”,用户只需一步即可选择使用 IWA 或联合 SAML IdP 进行身份验证。环境数据库是从 WSO2 IS 5.0.0.SP1 迁移到 5.1.0 的 postgresql(两个版本都发生了这个问题,经过一些调试后,currentStep 的值似乎为 2,其中只定义了一个步骤)。事实上我无法在本地重现这个问题,它可能依赖于我不知道的东西

标签: saml wso2is


【解决方案1】:

显然它看起来像是并发问题。

当多个并发请求发送到 SSO 端点而用户已经通过身份验证时,所有线程都在尝试处理修改相同身份验证上下文对象(currentStep 计数器)的请求,因此缓存的身份验证上下文进入无效状态。

有效的用例是客户端应该只向 SSO 端点发送一个请求,因此处理 UI 的团队必须修复它。但是 - 这只是一个快速解决方案,不能长期防止问题。我们必须真正用 WSO2 来解决它(也许自己修复代码):)

g.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-24
    • 1970-01-01
    • 1970-01-01
    • 2020-12-05
    • 2020-03-07
    • 1970-01-01
    • 1970-01-01
    • 2021-07-11
    相关资源
    最近更新 更多