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

BeforeMount error on OauthError #997

Open digitalmedia34 opened 4 years ago

digitalmedia34 commented 4 years ago

I'm submitting a

Background info

When trying to login using okta widget and the user is not assign to the application. I get the following error: Error in beforeMount hook (Promise/async): "OAuthError: User is not assigned to the client application. The application crashes afterwards

Expected behavior

I need to be able to catch this error in vue and display message to the user

What went wrong?

Please provide log or error messages if applicable.

Steps to reproduce

To reproduce, try to login with a user that is not part of the client application.

Your environment

swiftone commented 4 years ago

@digitalmedia34 - Thanks for the report. We need a bit more info to look further. Are you using our Vue SDK, or are you embedding the widget on your own Vue-based page?

digitalmedia34 commented 4 years ago

Hello, I am embedding the widget into my own vue page. The error is fine but for some reason a cant catch it when it comes back from callback url.


From: Brett Ritter notifications@github.com Sent: Monday, January 6, 2020 5:29:20 PM To: okta/okta-signin-widget okta-signin-widget@noreply.github.com Cc: digitalmedia34 digitalmedia34@hotmail.com; Mention mention@noreply.github.com Subject: Re: [okta/okta-signin-widget] BeforeMount error on OauthError (#997)

@digitalmedia34https://github.com/digitalmedia34 - Thanks for the report. We need a bit more info to look further. Are you using our Vue SDK, or are you embedding the widget on your own Vue-based page?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/okta/okta-signin-widget/issues/997?email_source=notifications&email_token=ABKGAQRACGWCVCTNNRACZ2DQ4OWEBA5CNFSM4KCENFGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIHAIUI#issuecomment-571343953, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABKGAQWGC5LHD266232XEK3Q4OWEBANCNFSM4KCENFGA.

swiftone commented 4 years ago

Internal ref: OKTA-272704

shuowu-okta commented 4 years ago

@digitalmedia34 The error trapping strategy may vary depends on the error comes back from Promise or redirectUrl.

To handle error from Promise, you can try aftererror callback hook to catch the error and customize the error handling on top of it.

For the redirect flow, which error exists in query/hash in the redirectUrl, you should be able to catch the URL in the Vue application, then parse the query/hash part to consume.