diff --git a/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/handler/impl/BasicAuthenticationHandler.java b/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/handler/impl/BasicAuthenticationHandler.java index e6b2ba68..4597ca3c 100644 --- a/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/handler/impl/BasicAuthenticationHandler.java +++ b/components/org.wso2.carbon.identity.auth.service/src/main/java/org/wso2/carbon/identity/auth/service/handler/impl/BasicAuthenticationHandler.java @@ -35,6 +35,7 @@ import org.wso2.carbon.identity.auth.service.handler.AuthenticationHandler; import org.wso2.carbon.identity.auth.service.internal.AuthenticationServiceHolder; import org.wso2.carbon.identity.auth.service.util.Constants; +import org.wso2.carbon.identity.base.IdentityRuntimeException; import org.wso2.carbon.identity.core.bean.context.MessageContext; import org.wso2.carbon.identity.core.handler.InitConfig; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; @@ -208,6 +209,8 @@ providing a Level of Assurance (LOA) and checking that in the TOTP and FIDO2 ser String errorMessage = "Error occurred while trying to authenticate. " + e.getMessage(); log.error(errorMessage); throw new AuthenticationFailServerException(errorMessage); + } catch (IdentityRuntimeException e) { + throw new AuthenticationFailException(e.getMessage(), e); } } else { String errorMessage = "Error occurred while trying to authenticate. The auth user credentials " +