
ManjunathOKTaK.29808 (Customer) asked a question.
Hi,
I want to display error/validation messages on sign in widget , example if account is locked out then show custom message like 'Account locked' and if credentials are invalid then custom message like 'Invalid credentials' etc etc
I implemented like below with help of https://github.com/okta/okta-signin-widget/blob/master/packages/@okta/i18n/src/properties/login.properties
but unable to show any custom error messages, please suggest,
i18n: {
en: {
'primaryauth.title': 'Sign in to Liberty Title',
'needhelp': 'Need Help Signing In? Or Sign Up',
'error.auth.lockedOut': 'Your account has been locked.',
'password.expired.title': 'Your password has expired',
'errors.E0000155': 'Unable to sign in.',
},
},

Hi Manjunath,
It sounds like changing the title and help link are working, but the error messages are not being displayed?
For general guidelines please see https://developer.okta.com/docs/guides/style-the-widget/style-self-hosted/#modify-strings
If an account is locked, the error returned on the authn will be,
"{"errorCode":"E0000004","errorSummary":"Authentica…Id":"oae..","errorCauses":[]}"
To override the default message the below can be provided as part of the widget config,
i18n: {
en: {
'errors.E0000004': 'I Can\'t Signin'
}
},
The tricky part will be knowing under what circumstances what errorCode is returned. One way to test this is in a dev environment setup the following callback for your widget,
oktaSignIn.on('afterError', function (context, error) {
console.log(error);
});
This will debug the error object (error code, summary, causes[], etc). With this you can figure out which error code to overwrite in you i18n configuration.
More about registering for Widget events.
Hope this helps