Search code examples
wso2wso2-identity-server

Intermittent authentication failures after updating WSO2 IS


After updating WSO2 IS using U2 I can see the following intermittent debug log when I try to log in to my SP.

TID: [-1234] [] [2022-12-05 22:13:30,322] [bcc826e3-5dcf-4a14-8048-6fd6b59d4599] DEBUG {org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator} - Error occurred during the authentication process, hence retrying. org.wso2.carbon.identity.application.authentication.framework.exception.InvalidCredentialsException: User authentication failed due to invalid credentials
...
    at org.wso2.carbon.identity.application.authenticator.basicauth.BasicAuthenticator.processAuthenticationResponse(BasicAuthenticator.java:699)
    at org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator.process(AbstractApplicationAuthenticator.java:89)
    at org.wso2.carbon.identity.application.authenticator.basicauth.BasicAuthenticator.process(BasicAuthenticator.java:141)
    at org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler.doAuthentication(DefaultStepHandler.java:512)
    at org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler.handleResponse(DefaultStepHandler.java:486)
    at org.wso2.carbon.identity.application.authentication.framework.handler.step.impl.DefaultStepHandler.handle(DefaultStepHandler.java:180)
    at org.wso2.carbon.identity.application.authentication.framework.handler.sequence.impl.DefaultStepBasedSequenceHandler.handle(DefaultStepBasedSequenceHandler.java:186)
    at org.wso2.carbon.identity.application.authentication.framework.handler.sequence.impl.GraphBasedSequenceHandler.handle(GraphBasedSequenceHandler.java:113)
    at org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultAuthenticationRequestHandler.handle(DefaultAuthenticationRequestHandler.java:159)
    at org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.DefaultRequestCoordinator.handle(DefaultRequestCoordinator.java:249)
    at org.wso2.carbon.identity.application.authentication.framework.servlet.CommonAuthenticationServlet.doPost(CommonAuthenticationServlet.java:53)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
...

And I cannot proceed to my SP in the browser. How can I fix this?


Solution

  • The above issue can happen if you have updated the IS using either WUM or U2 tools. If you open the network tracer of the application via your browser, you can see there is an error when loading the jQuery library. This is the root cause of this intermittent error. To solve this, you should replace every .jsp file (residing in the <IS_HOME>/repository/deployment/server/webapps directory) containing the

    <script type="text/javascript" src="libs/jquery_3.4.1/jquery-3.4.1.js"></script> with

    <script type="text/javascript" src="libs/jquery_3.6.0/jquery-3.6.0.js"></script>

    which is the new version of your jQuery library in the IS.

    Currently, the above issue is occurring with jQuery 3.4.1 and it can be fixed with replacing the script tags related to jQuery loading. But if the jQuery version changes, you have to find the exact jQuery version by going through the webapps.