okta / okta-signin-widget

HTML/CSS/JS widget that provides out-of-the-box authentication UX for your organization's apps
Other
376 stars 319 forks source link

Not able to track failed authentication using Okta singin-widget #1769

Open satyendera opened 3 years ago

satyendera commented 3 years ago

Here is summary of okta failed authentication tracking :-

We are using okta-signin-widget (version 4.5.0) with setCookieAndRedirect() function , we found renderEl function is providing callback for success and error only.

Where success in case of success authentication and error callback in case of widget rendering error or misconfiguration.

Do we have callback for failed authentication as well ? , although we tried failure callback but it didn’t work. Please have a look for below peace of code how we are using

const SignInWidget = require('@okta/okta-signin-widget'); signInWidget.renderEl(

  { el: '#DIV_ID},

  function success(res) {
    // here is success authentication scenarios handled
  }

  function error(err) {
    // here is rendering error scenarios handled

  }
);

We went through guide (Okta Sign-In Widget Guide | Okta Developer) as well but there is also failed authentication in not mentioned.

Please help here.

swiftone commented 3 years ago

@satyendera - I'm unaware of a built-in option to do what you're asking.

There are two main ways of reacting to "errors" from the widget:

However neither of these is written to trap user authentication issues (as those are viewed as "normal" user interactions managed by the widget, not "errors" requiring a response from the application).

Can you elaborate on what you are hoping to accomplish? Monitoring user activity may well fall to some other Okta services where it can be more efficient and secure.

satyendera commented 3 years ago

yea thanks @swiftone . it works and i am getting all the required information like

context.controller : primary-auth error.name : AuthApiError error.message : Authentication failed error.statusCode: 401

just curios to know is there any Okta services or hooks or any login failure callback also for this ?

thanks for your help.