-
Notifications
You must be signed in to change notification settings - Fork 209
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
Auth module response handler expects .json
keys presence when it is not returned in successful request
#307
Comments
Can you describe the steps you follow to log in? i.e. "launch web auth, click on twitter connection, type my credentials, the browser closes and my app shows this error" |
The Auth0 dashboard shows a successful login (under the user's We expect to see |
Thanks for that. |
hmmm, we rebuilt on |
@higgins I've tried to reproduce this following the steps you shared above and I did not run into any issues. Neither with iOS nor Android, using version 2.3.1. Please, check your lock file and be sure the version you're using is the latest. If not, you'll have to share with us more details like logging the network requests to understand what URLs are being called and what the server is responding. |
@lbalmaceda thank you for your patience and trying to reproduce! yes, we are using version 2.3.1 (confirmed with lock file and installed node_module). independently, we decided to move back to our earlier integration with the auth0 rest endpoints thank you again for your research here! |
@higgins I'm sorry you had to make that regression. It would be nice if you could provide us with any additional context that can help us debug this even further. You already shared the code snippet and the versions you were using. What about the networking logs? Stripping any sensitive data that could be included. @Widcket can you come up with anything that can go wrong in this iOS setup? |
without setting up a network proxy (safari simulator bridge won't let you persist network requests as far as i can tell), here's what we see from tracing via
I hope that helps! FWIW, we wonder if it USER dependent and not environment dependent. We've cleared as many caches as we can think of and still see the issue BUT this works fine for a different developer on our team. Same code, different credentials, returns response client expects. 🤷♂️ |
Do you mean that it works fine with a different Auth0 |
Sorry for the delay @lbalmaceda ( i was out last week ) No, we weren't able to reproduce for different user+password (with the same |
I'm still a bit confused. The developer on your team has tested this using the same code with the same If so, it would be really helpful to see those network logs (e.g. https://github.com/jhen0409/react-native-debugger). Or knowing for example if the user has MFA enabled, or if your app has any Rule that could change their particular user object. |
correct. it'll be a while till we can give the network logs as we're midway through a big upgrade and we've already removed this dependency. FWIW, the The summary pasted above is the best detail we can give as to the shape of the response at this time! 🙇 |
Hello, I am having almost the same issue on 2.7.0. Same exact process, but instead of username/password, we are using social login: All signs point toward a successful login (webauth closes, logs show successful auth and exchange, etc.) but the error is thrown due to no json. Comparing the social login user account to a username and password user account (/authorize, so no issues there) in the auth0 dashboard, there is nothing to indicate that there are any differences or issues with the social login user account. Edit: |
I don't understand why this issue is closed, is the solution to revert to rest apis?? I am having the same issue with social signin on Android only, error we get though is "network request failed".. Shows successful login in auth0 user history but crashes the app after returning from webview to the app. I have a separate issue created on the following link and have reached out to support audi but with no fix yet either.. |
I'm not in an environment to reproduce this bug anymore, but reopening as it appears to still be affecting folks |
I've done some further research into my case and found an interesting detail. Note, I have only tested this on android. The bug only seems to occur while the application is in debug mode. When I turned off remote js debugging (just debug/stop debugging on android), and debug only through the output console, I was able to get the login flow to complete and receive a valid token. So far, stopping debugging is the only workaround I have found, but for now it's workable. Environmentreact-native-auth0: tested on Note to other developers, not specifically related to this issue: |
@vishnuchd @Mr-Fraser @llaver Apologies for the delayed response. Can you reproduce this consistently every time you run the app? I downloaded the sample app (from here) and changed it to send a scope, connection, and audience value when doing web auth. Still, I cannot reproduce the error you are showing. Look at the videos for both scenarios with and without a specific connection requirement: -- without specifying connection Harlequin.Hawk.-.ULP.mp4-- specifying google-oauth2 Cyan.Lynx.-.Google.mp4I've tested these using a google social account, as was claimed here that a DB connection works fine. I believe the best way for us to debug this, given that there's a second issue for a similar bug report, is for you to give us a small sample app that when we run we can see this same issue you describe above. You can do as I did and take the sample app and copy the code changes you make here. |
@lbalmaceda Hi facing the same issue keeps getting this in the catch part of the code [TypeError: Network request failed]
}; |
@ANIBIT14 Is this for every run of just random ones? Maybe relates to a proxy or DNS issue on your device side. Are you able to check if the JWKS URL is accessible? |
@lbalmaceda this is for every run on android. JWKS URL is accessible on my device browser I checked. |
@ANIBIT14 I'm afraid that without new debugging info, different from what the rest provided above and that I used to attempt to reproduce the issue, I cannot help. It seems like it's failing to fetch the JWKS, which is then used to verify the received ID token. Have you tried with a physical device or a different android emulator? Perhaps you can debug the network request using the approach described here to understand why that request is failing. |
@lbalmaceda I am trying on physical devices, I even made an apk and tried. Will try debugging the network request |
@lbalmaceda for me the issue was happening because of this; react-native issue facebook/react-native#27250 |
Closing as @ANIBIT14 was able to solve the issue. |
Description
Auth module response handler expects
.json
key that does not exist on status 200 response.Reproduction
see the following error
Inspecting what
src/auth/index.js#responseHandler
receives, we see no.json
key present, hence the throw.{status: 200, ok: true, headers: REDACTED, text: "OK"}
Environment
react-native-auth0:
2.3.1
iOS:
11.0
react-native:
0.62.2
osx: 10.14.6
The text was updated successfully, but these errors were encountered: