Correct way to connect Instagram API - facebook

I am trying to connect Instagram to my app. The users will not be able to use the app without connecting to Instagram, therefore I technically need Instagram auth. But Facebook states the following:
Note that Basic Display is not an authentication tool. Data returned by the API cannot be used to authenticate your app users or log them into your app. If your app uses API data to authenticate users, it will be rejected during App Review. If you need an authentication solution, use Facebook Login instead.
So I had to implement a Facebook login. After Facebook login is complete, I am sending the user to Instagram auth window for a second authorization which feels weird for a user.
The other solution that I can think of is the following:
Use Instagram's user_id that is retrieved after Instagram auth and use it to create a custom auth method with Firebase. (I believe this would be rejected at app review)
What is the correct way to achieve this?
Sources:
Instagram auth: https://developers.facebook.com/docs/instagram-basic-display-api/reference/oauth-authorize
Firebase custom auth: https://firebase.google.com/docs/auth/web/custom-auth
NOTE: Facebook login has "instagram_basic" scope but that doesn't allow me to get instagram info or media of normal users (non-business accounts)

Related

Instagram API deprecation

I have an app that uses Instagram Login to use authenticate the users to the APP and the API which I using for this shown below
http://api.instagram.com/oauth/authorize/?client_id={client_id}&redirect_uri=http://localhost:8585&response_type=code
Is this API is going to deprecate should I move to Instagram basic display API for the same
Thanks in advance :)
Based on what is written here, you shouldn't use Instagram Basic Display API for authentication users to login to mobile app, but only to read and display data from Instagram. If your app uses API data to authenticate users, it will be rejected during App Review. You should use rather Facebook Login for authentication.

Why Instagram Basic Display api is not authentication solution

I want to add a 'Login with Instagram" button as a new feature to my application.
After reading the docs, I understood that the new API called - 'Instagram Basic Display Api' can't be used as an authentication solution.
"Data returned by the API cannot be used to authenticate your app users or log them into your app. If
you need an authentication solution we recommend using Facebook Login instead."
https://developers.facebook.com/docs/instagram-basic-display-api
If I understood the docs correctly they expect from the user to authenticate once with 'Facebook Login' as the primary authentication of the app and after that, the user needs to login in again to Instagram in order to get his basic profile.
Why can't Instagram be used as primary authentication? Anyone have a showcase to present that implement this flow?

Firebase get Provider Tokens

I am using Firebase for my app. I can successfully authenticate users with facebook and twitter providers. I have added the linking the user accounts. Now a user can authenticate with email and then connect the facebook and twitter providers. But I have a problem in this case.
The scenario is, the user signed in with email. Connect twitter and facebook accounts to original account. Then, try to send a tweet. Right there, twitter login page opens. The user did not know the twitter tokens for twitter provider. I need to get custom tokens from the firebase for facebook and twitter. This way its meaningful to link providers. How can I do that?

How to get instagram user ID/access tocken from iphone app

In my iPhone app,there is a switch for sharing the photos to users instagram profile.
How to get the instagram id in my app.
(i am not sharing the posts directly from the app,i woud like to send the particulars to server,from there sharing happens-)
I have registered my app in Instagram and got CLIENT ID,Client secret
You have to use those ID and SECRET to authenticate with Instagram to get the access tokens for your users to make requests to the API, check here to see how you can initiate the authentication flow and then find a solution that fits what you're trying to do.

Graph API save login information

I am using the Graph API for Facebook on my iPhone application. The problem is, I don't want the user to have to re enter their email address each time they want to login to integrate Facebook with my app. Is there a way to save and auto fill the login information using the Graph API?
Using the Graph API, there is no need for you to store the credentials, more than that, you should NOT store the credentials. As explained in the API dedicated help page the authentication process is handled by a secure token.
Meaning that if the user is already authenticated on Facebook using another application, it might be ( based on authentication process used ) already authenticated within your app.
You might check the token validity by using the isSessionValid method from the Facebook class.
Have a look to the iOS Facebook SSO link, it explains everything you need.