Parse-server: Login Instagram

Created on 23 Apr 2017  路  11Comments  路  Source: parse-community/parse-server

Hi !
I would like to be able to connect Parse server with an instagram login (Like Parse does it with FacebookUtils). Do you know if it's possible now?

Otherwise how do I do?

thank you very much

All 11 comments

It's available in Parse Server already.

https://github.com/parse-community/parse-server/blob/master/src/Adapters/Auth/instagram.js

I believe you add it to your server config like so:

{
  auth: {
   instagram: {}
  }
}

According to the adapter, it doesn't require any options so just pass an empty object. The client should send authData that contains access_token and id returned after authentication with Instagram.

@JulienLevallois did it help?

Mmm but There is no function with IOS SDK for example to connect with Insta?
Like this :
image

Do you have an example code? With login via Cloud Code for example

@JulienLevallois i'm also looking for a way for instagram login. Did you find a way to accomplish that ?

No but you can create one yourself, look into the facebookUtils code

@mzgnr no.... and you ?

The main example for logging with 3rd party auth is the ParseFacebookUtils repo. You need to acquire the access token from Instagram鈥檚 oauth flow and then use a similar strategy as the Facebook one!

I managed to recreate FacebookUtils and my login works with the token instagram but I have a question. Instagram makes it clear that its token does not have an expiration date but it can change, be revoked.

In this case, the instagram requests will return an error and the user will have to be logout. But when it is going to want to re-login, the token will have changed then how will Parse recognize this user as an old user? Will Parse create a new user? I would like to understand the logic

All tokens expire, you need to send the user ID alongside the accessToken and everything will be fine :)

So normally this is good? Parse Server will know the user even if the token is modified

capture d ecran 2017-07-18 a 17 39 44

Yes! This should work

Was this page helpful?
0 / 5 - 0 ratings