Closed laharshah closed 4 years ago
any update on this issue?
I've got the same problem. It's not a huge deal in that they can't login, so fine. But it would be nice for us to be able to catch the error, so we can redirect to a failed auth page
i have same problem, created a rule for SPA application in okta for allowing only specific groups to access the application. When a user not present in groups tries to login this issue is creeping up in my client side application. Please try to resolve this
How to catch this error???/
As you can see the implicit callback component is very simple, containing only a single call to okta.handleAuthentication()
The error you are trying to catch is most likely thrown from this method.
I recommend replacing the component handling for the /implicit/callback
route from the Okta provided component to one of your own, which wraps okta.handleAuthentication()
in a try { ... } catch (e) {
then you should be able to handle the error and display a message / link to the user
As you can see the implicit callback component is very simple, containing only a single call to
okta.handleAuthentication()
The error you are trying to catch is most likely thrown from this method.I recommend replacing the component handling for the
/implicit/callback
route from the Okta provided component to one of your own, which wrapsokta.handleAuthentication()
in atry { ... } catch (e) {
then you should be able to handle the error and display a message / link to the user
Not working in a try catch block, but okta.handleAuthentication() is a promise so you can use okta.handleAuthentication().catch((err) => ...);
Closing this issue: handling a rejected promise from .handleAuthentication()
should cover the cases listed (https://github.com/okta/okta-oidc-js/tree/master/packages/okta-angular#oktaauthhandleauthentication)
If anyone continues to have a problem feel free to open a new issue with details and reference this issue.
Updated link as the SDK was moved.
https://github.com/okta/okta-angular/blob/master/lib/src/okta/components/callback.component.ts
I am using the OKta hosted login.
How do I catch the error on 'implicit/callback' route. When the unassinged user(User - not assigned people list for the application) try to login, it redirects to the blank page: "implicit/callback" with the following error in console.