Sign In Register

How can we help you today?

Start a new topic

Instagram Authentication

Hey!


For an upcoming project we need users to be able to login with their instagram account. After running a few tests Gamesparks looks like a good choice for what we need (partly because it already offers a wide range of federated login capabilities) but this one is quite important to us as well.


Are there any plans to "natively" integrate this with the platform and if so do you guys have a timeframe for that?


If not, could you provide any help with implementing this in cloud code?


Thanks a lot for your efforts in advance!


Best,

Fabian


Hi Fabian,


I don't believe there are plans to do support it natively at the moment so I couldn't give you a time frame I'm afraid. If they have a web api you would be able to use SparkHttp to make calls to it and retrieve certain details for a user if the api supports it. You wouldn't be able to use it as a means to authenticate with GameSparks though. You would have to use one of the built in social connectRequests or the AuthenticationRequest to do this first.


Regards,

Liam

Hi Liam,


thanks for the info. Unfortunately we would need the user to feel like he is in fact authenticating with instagram, so having them manually register first or use a different provider and then "link" the account is not really sufficient.


I'm thinking if it might be possible to automatically register an account with Gamesparks based on the info we can pull from instagram so it fells like one thing? I'm afraid this won't really work well if they want to change their instagram password though...


Is there any way to generically accept OAuth2 tokens from any auth provider like e.g. the firebase custom authentication API?

I understand that you have nothing on the roadmap to integrate more providers at the moment but a system like that would allow any customer to do it themselves if necessary.


Best,

Fabian

Having thought about it some more I believe the only feasible way right now would be something like this:


First thing would be to set up a separate auth server that accepts instagram logins via their api. This server would then register a new user on gamesparks with an appropriate display name and a uniquely generated username and password. whenever someone wants to log in with instagram they get routed through this server which then authenticates with gamesparks on their behalf.


While this should work I'm not entirely happy with the approach as it has security implications like somehow having to store the generated username-password-pairs (and the corresponding instagram account) out in the wild. Any thoughts on this?

And of course having to properly host this server to ensure high availability, sufficient speed across regions and proper backups. That should be all right on AWS etc. though.


I think I would be able to pull and push all the instagram-information I want directly through gamesparks once this link is established if I manage to maintain a valid token, which would need to be sent to gamesparks every once in a while or upon request. I still need to have a look at how long instagram auth-tokens are valid...


Not having to do something like this is the main reason for choosing a BaaS like gamesparks in the first place, but I know I'm asking for the icing on the otherwise already gorgeous cake! ;)


Would be great to get some thoughts and insights from you guys!


Thanks,

Fabian

Hi Fabian,


What you could do is have the users authenticate via DeviceAuthentication and pass up the Instagram access token via scriptData in that request. Then use this token (with SparkHttp) to access and store whatever data is relevant to the users in runtime collections on GameSparks. You'd have some form of InstagramId which could be used to tie all of the data back to that specific user. Obviously if the user changed device they would have a new deviceId which in turn would create a new player but if you were to stick to using the InstagramId as the way to identify user data then this could work. It would require some thought and thorough investigations. I'm not familiar with the Instagram Rest API so I'm not sure if its possible.


Regards,

Liam

Hi Liam,


That's an interesting idea...

Getting a unique (and persistent) user id from instagram is not a problem, so it could work.


To be honest, I'm not too fond of the idea of potentially having multiple user accounts that would need to access or even sync data that's stored somewhere for various obvious reasons but I'll think about how the impact could be minimized and if this might actually be a valid option.


It's really hard to beat a proper implementation though of course...


Thanks,

Fabian

Hi Fabian,


Yes that's understandable. I'll run this by our dev team and see if we can get it logged as a feature request for you.


Regards,

Liam

as far as i can see this should not be very different to the facebook or google plus connects, where a token is retrieved from oAuth with instagram and then passed to gamesparks, where essentially through sparkhttp any information is then retrieved from the instagram end to store on gamesparks..


1 person likes this

hey any update regarding this feature request?

Login to post a comment