-
Notifications
You must be signed in to change notification settings - Fork 232
ERROR Error: Uncaught (in promise): AuthSdkError: Unable to retrieve OAuth redirect params cookie #706
Comments
@lawchihon This is a known issue with the latest version of Chrome. We have fixes in the latest versions of our modules. If possible, update to |
Even after upgrading to |
@bordecal - A few questions:
|
|
We suspect this is due to some incompatibilities in not-latest Safari version with the cookie SameSite changes done for Chrome. We have created a ticket to research this, but anyone that can provide reproducible cases and specific version information can greatly help figure out what is going on. Internal ref: OKTA-286866 |
We are getting this error with okta-react in Chrome (80.0.3987.95) on IOS (Using a fresh incognito window). Using okta-react/3.0.0 with the workaround you suggested in #719 for our LoginCallback. EDIT: The error isn't exactly the same as reported. The LoginCallback component is printing out the error message: AuthSdkError: Unable to retrieve OAuth redirect params cookie |
@alexspence What version of IOS? Have you tried it in the XCode device emulator, and if so, does it reproduce there? |
IOS 12.4.1 - Can't run chrome on IOS SImulator - will try it on safari and report back. |
My coworker that is having the issue reports the issue does persist on Safari, I am not able to reproduce in safari in the simulator. |
@aarongranick-okta - is there any workarounds I can try or more information I can send to help with this? This is blocking us from going live with our Okta migration as a significant portion of our user base uses iphones. |
I was able to reproduce the issue with IOS 12.4 in xcode simulator |
Verified that upgrading to latest version of IOS solves this. We are just going to add a message to the error page to ensure they upgrade to the latest version of IOS. |
@aarongranick-okta I upgraded to the latest 2.x version and it seems to less happen. |
@lawchihon - There is an intentional time limitation on that login. If you go to the login page and wait too long, the resulting login will not be considered valid, particularly if you are using the PKCE flow (which has a more strict limitation). Does this describe what you are seeing? |
@swiftone I believe thats what Im seeing. If that's the case, is there anyway we can choose where to redirect for invalid login? Coz now it is kind of jumping back to okta page. |
Internal ref: OKTA-295177 |
Is there any update on this? Using okta widget and getting this error on iOS version 12. It works on 13. Unfortunately we cannot ask our users to upgrade to new version of iOS. Is there any workaround for this? Just so you know that we did upgrade to the latest version of modules but the problem still happening on iOS 12. |
@tek-bkarimi It's possible this issue is related to "secure" cookies. By default, this option is enabled, but it can be disabled by setting:
in the config passed to the AuthJS constructor, as described here: https://github.com/okta/okta-auth-js#additional-options |
Hitting this issue as well in our app. @aarongranick-okta according to the docs, disabling secure cookies
Has there been any progress in identifying this issue and finding a fix? We also cannot ask our users to update to iOS 13, since many of them use iPhone 6. We use okta-react |
We are unable to reproduce this bug, and it is difficult to know which iOS/safari bug may be responsible. If any users are still seeing this issue, please try with the latest version of okta-react/okta-angular and let us know if it is still a problem an any reproduction details. |
@swiftone We're experiencing this issue as well in our app. We're using There is no |
@m-lehti We believe that any issues with the OAuth redirect params cookie were fixed in 3.2.5. In fact, we have changed the error message so if the message still says "cookie" that indicates that an older version is being used. |
@aarongranick-okta Thanks for taking a look. To clarify from the points you've made:
|
@m-lehti Are you including the okta signin widget in your app or are you redirecting to Okta for signin? |
@aarongranick-okta We are redirecting to Okta for signin with the |
@m-lehti The data is set here: https://github.com/okta/okta-auth-js/blob/3.2/packages/okta-auth-js/lib/token.js#L632 I know it is difficult to debug within an emulator, but it would be helpful to know where it is failing. We have logic to use cookies if sessionStorage is not available. But we would expect these cookies to have an issue on IOS 12 with the sameSite setting, which is one reason we are favoring sessionStorage. If sessionStorage is disabled for some reason, it could be falling back to cookies. We do allow customizing the sameSite / secure flags on cookies although this is generally not recommended because it may cause other problems: https://github.com/okta/okta-auth-js/blob/3.2/README.md#additional-options If there is no avoiding cookies, you might try different values. If you set secure to false, it will use insecure cookies even on HTTPS connection. If you set sameSite to "lax" it will use that value even if the cookies are secure. |
@aarongranick-okta , I've taken a look at the lines you've tagged and noted after removing node_modules and running I haven't been able to check the sessionStorage status during/before the redirect: I can share my findings for what the data looks like on the callback route if that helps: Token state comparison on callback screen:iPhone 6 Plus Safari Regular tab - working
LocalStorage
SessionStorage
iPhone 6 Plus Safari Private tab - experiencing error
LocalStorage
SessionStorage
LocalStorage
SessionStorage
LocalStorage
SessionStorage
For further diagnosing I've looked at the instructions for setting up okta-auth-js SDK locally (https://github.com/okta/okta-auth-js/blob/3.2/README.md#building-the-sdk) and linking it to our project to make debug related changes (mainly to see what's being assigned / is available on the affected lines of token.js); would that be the best way to figure out what's going wrong and if so are there any gotchas for yarn linking a local sdk package to the node_modules of another package? |
I have exactly the same issue using: @okta/okta-angular: 2.2.1 in Angular 10.1.3 I've tried removing and re-installing node_modules and also tried implementing my own component to handle the redirect, but I still get the same error. |
@m-lehti @alsoicode We are aware of an issue affecting iOS 12 and are working on a solution. Can you confirm that the error you are seeing is happening only on iOS 12? |
This error is happening on OS X. I'm using Big Sur Beta 11.0 and Chrome 6.0.4240.80, but other browsers are exhibiting the same behavior. |
@alsoicode When a login redirect is handled (by |
@aarongranick-okta Hmm. I'm using the |
@aarongranick-okta OK, I think I've isolated the issue on my side to a race condition when supplying the Okta config via a service. |
@aarongranick-okta, to confirm your question our team is only experiencing the issue on iPadOS 12.4 and iOS 12.1: on desktop as well as newer mobile devices the error isn't seen and the app functions as expected. |
@aarongranick-okta Problem solved. It was due to a race condition while retrieving the Okta config that I've fixed. Thanks for the help. |
@alsoicode Great! Glad you were able to fix it! |
I'm facing this exact same error |
@mig82 can you try the latest version (5.0) and use
|
Thank you for the assistance, @shuowu .
Looking at the response headers of the
and this (I've tried to prettify it for ease of reading):
Notice the |
@mig82 Can you update the code in https://quantum-demos1.s3.eu-central-1.amazonaws.com/okta/glitch.me-app.html and I'll try if I can reproduce the issue. |
@shuowu I got it to work using 5.0.0 and Seems a number of things were wrong. First, my Okta app was configured as a Web app (with I had to create a new Okta app because it's not possible to enable the same one to be used in both ways. Perhaps an enhancement to consider? Also, I've found it very confusing that parameters can be used in either the instance declaration of At some point I also got this error:
As you can see, these two URL's are essentially the same, except one of them has a double slash character. I'd suggest you could make your JS library smart enough to remove these involuntary double slash characters. Thank you very much for the assistance. |
@mig82 Thank you for the valuable feedback! We will definitely take this in consideration as we work to improve the developer experience with the signin widget and our other SDKs. |
There were many possible causes of this error and we believe we have fixed / compensated for most cases. If you are still experiencing this issue with current versions of our SDK, please let us know. |
I'm submitting this issue for the package(s):
I'm submitting a:
Current behavior
Keep getting
ERROR Error: Uncaught (in promise): AuthSdkError: Unable to retrieve OAuth redirect params cookie
when redirect from okta loginExpected behavior
Login without error
Minimal reproduction of the problem with instructions
Call
this.oktaAuth.loginRedirect()
Extra information about the use case/user story you are trying to implement
Environment
node -v
): v12.13.1The text was updated successfully, but these errors were encountered: