-
Notifications
You must be signed in to change notification settings - Fork 103
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
onLoginFailure being triggered every time #80
Comments
I get this as well, it also gives a code in error response object, insead of token and HTML page is logged out into console. |
i am also facing that issue. |
Also facing the problem, Android only |
I have also the same problem, both on real android device and ios device. The first code is correctly retrieved but it's the request to https://api.instagram.com/oauth/access_token which gets a 403 response (but not on ios simulator) |
Found the issue but this is rather unexplainable ... Instagram changed the fields app_id and app_secret used with access_token to client_id and client_secret. So in the file instagram.js from your react-native-instagram-login replace the following code
with
And your login should work again. Why the requests are working on the ios simulator and failing with a real device is totally beyond me though ... |
athorisation on instagram is returning code key instead of acess token key, as mentioned above you can make changes in libraray's main file accordingly. |
i forked and fixed the issue. Here is my package: |
why not to copy lib code locally and change untill lib not updated. |
@Rramandeep Our app is already live on store. |
@Dhanraj-bidchat no offence bro, but my app is under developement that's why. |
@Rramandeep thats fine bro. |
I updated the library, so you can remove the old version and install the new version. Feel free to comment here. Love guys. |
You also change the appId to client_id
|
@kiritm-nimblechapps I forgot it. Thank u. i updated. |
Getting this on the "onLoginFailure" Object { _: "" } The latest package was working a while ago. |
@tuladharjaa can you give me steps to get onLoginFailure? |
The screen capture is on the following link: The code I have used: |
Tried to see if I had a login problem again on my app but it's working on iOS both device and simulator for me right now. @tuladharjaa can you step into the library with the debugger and see what are the result of the instagram requests ? |
The returned URL from WebView does not contain the codes. It just returns the redirectURL I am getting this on an Android device. |
@tuladharjaa you tried android login with same user that you loged in on iOS?? |
I have added the account as tester and was working previously on Android. I have not tried it on iOS. |
@tuladharjaa can you try one common test account on both and let us know please? |
On iOS it is working fine. |
Just tried with an android emulator and it's working fine on my end. |
I just checked it again, it still works normally. I don't know the exact error. |
I installed the version 2.0.2 and then made changes on the Instagram.js file and it is working fine. |
Hey guys! Thanks for your efforts.. but, I'm receiving on onLoginFailure an object with the code. Anyone can help me? |
@denisprado show me your error, your code and your current version you are using |
@hungdev HI. My component is like that:
and I'm using the last version, 2.0.4. The error is the onLoginSuccess not receiving any data. I'm receiving a code onLoginFailure. |
@denisprado show me error from onLoginFailure func |
On v2.0.5 I'm having the same issue. It looks like a problem with the axios post call.
using
|
I'm also having this issue on 2.0.5. Calling |
The issue returned as unexpected as gone for me. I've been trying for an hour to figure out what the problem is and for now I see the possible issue with setting the cookies along with returning the response, seems like axios needs to be configured correctly for this. |
@Tymofiev did you find any solution for this? |
+1 |
1 similar comment
+1 |
I have tried using Fetch as @buraktt suggested but it still returned Network Error which I guess is the same with axios error. Still looking for any solution. |
Looks like issues appears because of spaming with |
But i tried with postman with the same account, and it still works. I don't know exactly where the problem is coming from. |
And we should only discuss in 1 thread. Please don't discuss the error: returned 403 here to avoid distractions |
Hmm, one more thing that I noticed that it didn't work when I didn't receive notification on IG app about new login from some browser. Have no idea how it can be connected though |
I solved the issue and still not sure why it doesn't work. /authorize works and returns you the code. You may use PostMan on /access_token and it works. Although using /access_token within the package throws a 403. Switching axios -> fetch, still throws the same error ONLY on /access_token. What I ended up doing is making an API call to my main application (PHP app) which I pass the CODE from /authorize. Then doing the EXACT same call to /access_token and returning the token. Not sure why this method works since it's exactly the same, but doing the call within the app is getting blocked. |
@Dlas1212 You're talking about making the call within redirectUrl on backend, right? |
InstagramLogin - leave the app secret key empty, which will return you the authorize code in loginSuccess(). Then make your api call - pass the code - do the /access_token there and return access_token to your app. |
Oh, now it makes sense to me. Thank you :) |
I wanted to highlight this answer, it's simple, but it solved my problem |
It's already using client_id and client_secret |
does anyone have a solution? i used fetch still get 403 error |
The login was working fine but after adding another Instagram tester user the "onLoginFailure" keeps triggering instead of "onLoginSuccess".
The text was updated successfully, but these errors were encountered: