Closed OtiZ2 closed 3 years ago
Hi @OtiZ2 sorry to hear you are having issues. Can I ask which version you are using?
Hi, "laravel/framework": "^7.0", "dymantic/laravel-instagram-feed": "^2.6",
Okay, thanks. And have you added your Instagram account as a test user?
Alright, great. Next step is to check if there is anything in the logs which can give us more info. The package should log the error.
In the /storage/logs/laravel.log is just this
This call return the error message
Yes, that makes sense. What domain are you starting the auth request from? Is this on your dev environment?
I try localhost, and production domain. Same result. https://lulu.upcyklovane.com/instagram/auth/callback
Okay. The problem seems to be that there is somehow a difference between the redirect_uri sent when starting the auth process, and when exchanging the code for a token. Can you possibly show me your config file?
Config file
Ho @OtiZ2 have you managed to have any progress on this? I can't any issues with your config file. I have just tested with a fresh Laravel install and a fresh Instagram/FB app and it worked fine, so I'm not sure what to suggest. What do you have set as your APP_URL in your .env file?
This is from .env
Hi @OtiZ2 Sorry for the late reply, I was away. Unfortunately I cannot think of what the problem is. The only idea I currently have is for you to manually edit the redirectUriForProfile
method in the Instagram.php file in the package, and log out the value of the url before it is returned. That method gets called twice in the OAuth process, and the value it returns should be the same, but it seems that in your case it is not. Maybe by logging it and checking what value is returned we can find something useful.
Hi, this is log output: [2021-08-09 08:29:04] production.ERROR: redirectUriForProfile: {https://lulu.upcyklovane.com}/{instagram/auth/callback}
[2021-08-09 08:56:15] production.ERROR: redirectUriForProfile: {https://lulu.upcyklovane.com}/{instagram/auth/callback}
[2021-08-09 08:56:15] production.ERROR: https://lulu.upcyklovane.com/instagram/auth/callback
[2021-08-09 08:56:16] production.ERROR: Instagram auth error: unknown error message
Hmmm, that seems all correct. Can you please send a screenshot of the original error you are getting.
Hey, thank you for your greate Package! Im facing the same Issue on my local development... Seems to have nothing to do with the Redirect URL if i change it than i get an Error response before authenticating. Did you found a Solution on this? On the Facebook Site im using the Instagram Basic Display App, is this the right one? Thank you!
HI @julianlaibach, sorry you experiencing issues. I'm not sure if @OtiZ2 ever found a solution for the above. Can you tell me a bit more about your setup and everything (what dev environment you are using, what version of this package and Laravel, etc) and I can try assist you. Have you also added yourself as a test Instagram user on the Facebook app you created? Yes, Instagram Basic Display is the correct one.
Hi Michael, thank you for your Response! As a Dev environment i use a Docker Container. I also have a SSL Certificate on the Local URL. The Package Version is 2.6 The Laravel Version is 8.0 Both the URL in the config and the URL at Facebook are the same. Yes i also added the Test user and verified it in my Instagram Account. Its somehow strange because i dont know what to do else, i think i tried everything @OtiZ2 did you found a Solution for this Problem? Thank you!
Hi @julianlaibach can you share a screenshot of the error you are getting?
Sorry for my late reply... Here is everything from the Log File:
[2021-09-13 18:54:00] local.INFO: redirect URL: https://barth-fs.test/instagram/auth/callback
[2021-09-13 18:54:17] local.INFO: redirect URL: https://barth-fs.test/instagram/auth/callback
[2021-09-13 18:54:17] local.ERROR: Instagram auth error: unknown error message
Im not sure what exactly causes this, i tried nearly everything, also on production... The only thing im not sure about is do i need to do the App Review on Facebook? Also if i added the Account to the Test Users Thank you!
HI @julianlaibach no worries. Do you see an error of any sort during the auth process? The error logging in this package is not so robust, and isn't providing enough info for the error. It would be helpful if I could see the actual error or response you get during the auth process.
I don't think facebook app needs to go through App Review, just make sure it is live, and you have set up the Instagram account as a Test Instagram User, and approved the request from Instagram.
Hi Michael, so i think maybe im a bit closer...
[2021-09-14 06:53:06] local.ERROR: Exception: Dymantic\InstagramFeed\Exceptions\AccessTokenRequestException: Client error: POST https://api.instagram.com/oauth/access_token resulted in a 400 Bad Request response: {"error_type": "OAuthException", "code": 400, "error_message": "Error validating verification code. Please make sure you (truncated...) in /var/www/html/vendor/dymantic/laravel-instagram-feed/src/Profile.php:62
This is what i'm getting if i Log the Exception in AccessTokenController / handleRedirect If i google the Error i get the same hint as mentioned from you, the Redirect URI but i tested and im sure that those both match...
Do you have any thoughts on it? Best Julian
H @julianlaibach, sorry about the late reply. I am at a bit of a loss, I can't really find any new information about this, and I can see from your logs above that the redirect_uri is the same, so I can't see where the problem is. One idea, but it is a bit of a stretch, is that I give you the API key and secret for a FB/Instagram app that I know is working, and add your IG account as a test user, and see if the error is the same. At least this will be able to rule out whether it is an issue on the Facebook settings side, or something with the package.
I'm going to close this for now, if anyone has a similar issue please open a new issue.
hi everyone, sorry for late reply. No do not find any solution for this yet.
Hi @OtiZ2 I can only offer you the same thing as I offered @julianlaibach above, where you can try your setup using a FB app that is known to work
Had this problem using same versions. Personally had to install this package manually without composer and ran into multiple problems. Resolved this issue by manually adding Dymantic Package to Bootstrap cache Packages.php & Services.php.
I did run into the same problem, so i removed the app from the connected applications in Instagram.
You can follow also this guide: https://smashballoon.com/doc/instagram-api-error-message-reference/
I get this message right after click on allow.
Client error:
POST https://api.instagram.com/oauth/access_token
resulted in a400 Bad Request
response: {"error_type": "OAuthException", "code": 400, "error_message": "Error validating verification code. Please make sure you (truncated...)