Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught (in promise): AuthSdkError: Unable to parse a token from the url #19

Open
laharshah opened this issue Sep 7, 2018 · 3 comments

Comments

@laharshah
Copy link

When accessing the page 'implicit/callback' directly from the url, getting the below mentioned Error in console.

I think this error should be handdled. Is there a way that we can override or implement different OktaCallbackComponent and hanndle this kind of errors!

ERROR Error: Uncaught (in promise): OAuthError: User is not assigned to the client application.
Error
at eval (OAuthError.js:20)
at Object.../../../../@okta/okta-auth-js/lib/errors/OAuthError.js (vendor.bundle.js:134)
at webpack_require (inline.bundle.js:55)
at eval (token.js:8)
at Object.../../../../@okta/okta-auth-js/lib/token.js (vendor.bundle.js:183)
at webpack_require (inline.bundle.js:55)
at eval (clientBuilder.js:23)
at Object.../../../../@okta/okta-auth-js/lib/clientBuilder.js (vendor.bundle.js:85)
at webpack_require (inline.bundle.js:55)
at eval (index.js:2)
at eval (OAuthError.js:20)
at Object.../../../../@okta/okta-auth-js/lib/errors/OAuthError.js (vendor.bundle.js:134)
at webpack_require (inline.bundle.js:55)
at eval (token.js:8)
at Object.../../../../@okta/okta-auth-js/lib/token.js (vendor.bundle.js:183)
at webpack_require (inline.bundle.js:55)
at eval (clientBuilder.js:23)
at Object.../../../../@okta/okta-auth-js/lib/clientBuilder.js (vendor.bundle.js:85)
at webpack_require (inline.bundle.js:55)
at eval (index.js:2)
at resolvePromise (zone.js:809)
at eval (zone.js:728)
at rejected (okta.service.js:24)
at ZoneDelegate.invoke (zone.js:388)
at Object.onInvoke (core.js:4749)
at ZoneDelegate.invoke (zone.js:387)
at Zone.run (zone.js:138)
at eval (zone.js:858)
at ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:4740)

@vishnualeti
Copy link

vishnualeti commented Mar 8, 2019

Hello laharshah,

I faced the exact issue which you got. Am using Angular 6 in my project. I got this while logging to my application.

How I resolved this is:
I was calling "okta.handleAuthentication();" method in normal logins. This is why I faced that issue.
If you are logging in with your API(expressJs), do not call the Okta functions/methods.
Where as if you are logging with Okta SSO, call them usually. You will not face the issue.

@aarongranick-okta
Copy link
Contributor

internal ref: OKTA-269846

@aarongranick-okta
Copy link
Contributor

@laharshah @vishnualeti Thanks for reporting this issue. We hope that you have been able to workaround this issue.

The handleAuthentication() method can throw an exception, which you can handle in your application. The recommended way to do this is to copy the code for the CallbackComponent included with the SDK and add it to your app as your own CallbackComponent. Then you can customize the logic, including catching this exception.

See here for more info: https://github.com/okta/okta-oidc-js/tree/master/packages/okta-angular#oktacallbackcomponent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants