<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00006z09C2CAIOkta Classic EngineSingle Sign-OnAnswered2021-09-20T05:03:09.000Z2021-05-21T11:02:10.000Z2021-05-25T09:15:23.000Z
Custom error/validation messages on angular signin widgets

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.',

    },

   },


  • ErikM.01943 (Customer)

    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

    Expand Post
This question is closed.
Loading
Custom error/validation messages on angular signin widgets