Associate user with Instagram Basic Display API response

Hi,

I am developing an app that allows users to connect their Instagram accounts. However, I have a problem that someone may be able to help with.

So, in the app(frontend) the web view is presented with the specific URL that Instagram API requires to receive the necessary access token, in the URL you have to supply a redirect_uri which is where Instagram will send its response (authorization_code), you then have to send that authorization code to another Instagram URL to which it will respond with the token, I need to store this token in my database. The redirect_uri is a domain that points to my backend server, and I have to keep it this way since Instagram requires that the redirect_uri uses HTTPS.

Finally the problem, I don't know how to associate the authorization code with the user that made the request since Instagram acts as a middleman between the front-end and back-end. Upon signup, each user is assigned a user ID. I tried to find a way to include that in the redirect_url with no luck.

Thanks in advance!

Associate user with Instagram Basic Display API response
 
 
Q