Hi everyone! I have been struggling for days to get the oauth with instagram’s graph api to work.
Goal:
- User should be able to login with instagram and oauth with me
- I want to be able to save the access token to their profile so that:
- I can pull in their instagram library and complete other calls through their instagram
I am stuck at saving the access token and have checked all forum posts, gpt keep halucinating so clearly doesnt have the answer either, does anyone know how to save an access token from the oauth api?
The other thing i tried was using the embed url that meta gives which successfully completes the oauth but then bubble io throws an error when redirected back that the “state” is missing, does anyone know how this could be fixed?
THANK UUUU
Hey there,
Are you using a plugin? What’s your setup? Can you please provide screenshots or explanation of what’s going on.
Thank you
Hey Jonah, hope all is well (thanks again for previously helping me out with the betteruploader) and thanks for the reply!
I tried the following two setups:
-
Setup 1: Bubble’s API connector for the OAuth
Issues with this option:
a. Successfully redirects & allows user to login in to Instagram BUT gives an error by Instagram after redirecting back saying that the scope is invalid even though it’s the same scope from Instagram’s own embed url
b. Doesn’t allow me to save the access token that Bubble’s api exchanges. I need to store the access token so that I can trigger another call to get a long-lived (60 days valid) access token.
-
Option 2: Redirecting the user in the workflow to the embed URL provided by Instagram:
Works perfect from Instagram’s end and successfully redirects back to Bubble io with the code in the url (I need the code to trigger the next api call to get the access token) BUT on redirect bubble io throws this error saying that a “state” is missing:
Do you have any thoughts on how I can get to my goal of getting the instagram o-auth to work AND saving the access token for me to use for further api calls?
Cheers!
Alice
Hi, mulleralice984
I did in that way:
build API conector to get token:
Create a button to connect Instagram:
when a page is loaded, I get code, that instagram provide, that code is used for get token
with token I can call anothers API´s like getLongToken, getUserDetails
I hope could be helpfull
1 Like
Thank you so much for your help!
I set it up exactly as you suggested but unfortunately on redirect I get this error from bubble:
Do you not get this error from bubble when instagram redirects back?
I did some research and apparently Bubble sets a state automatically that it expects to be sent back from Instagram as a means to verify the session of the user, but I dont know how one can amend that state
Any ideas?
Hey @basecisco!
Just following up, how did you solve the redirect back to bubble from instagram without bubble throwing an error regarding the state parameter missing?
Does it show up for you?
Would be super grateful for your help as I am totally stuck on this 
If you wish I can make a video call to solve together
I didn´t use state.
I Just use “get code from URL” code is a parameter that Intagram send back to my URI Redurect page.
With that code, I can call API to get token.
Thats what I tried to do as well but I get the state error (this forum also faces the same issue: Stuck manually authorizing with OAuth2: “Invalid state from oauth provider” - #4 by hattenbachlars)
Sure that would be great, when would you be available?
Hi! I want to piggyback off this thread because I am having similar problems with Instagram oauth.
Alice, did you end up solving this problem?
Also- my current situation re: Instagram oauth:
Connect two oauth (Google & Instagram) under the same user - Need help - Bubble Forum
@steven.h.liu.1 still haven’t figured it out
are you facing the same problem with the state parameter being forced in?