originally posted in:BungieNetPlatform
View Entire Topic
[edit 10.05.15]
Removed Facebook login code (no longer supported by Bungie.net).
Updated Xbox Auth flow.
[edit 11.03.15]
Added "Stay signed in" flags for Xbox and Facebook logins. Should hopefully allow you to stay in for a longer period of time.
[edit 09.03.15]
While messing around with my brother's account, I realised my function didn't take into account if someone used an unregistered account to sign-in. I've updated it to account for this and I've also added more comments to make it more clear what's going on (mainly for Xbox sign-ins...).
[original post]
While in the process of putting together a pastebin of my code to try and debug what I was doing wrong, I actually managed to get PSN sign-in working (I can't say exactly what it was that was wrong though...), and while I was at it I went and figured out Facebook and Xbox sign-ins too. The latter (Xbox) is just plain ugly because they've rigged their sign-in form to "Require Javascript", but if anyone has a cleaner solution more in-line with how PSN and Facebook are done, please let me know.
Here's a straight forward PHP function you can use to enable logging in with all 3 methods, resulting in either success or fail. If it wasn't for @abl's [url=https://www.bungie.net/en/Clan/Post/39966/106896643/0/0]post[/url], I was pretty content with the idea that this wasn't possible (not for all 3 anyway, especially Xbox *scoffs*). If people have suggestions on how to make this better, please let me know.
[url]http://pastebin.com/pQTH7WR7[/url]
English
#api
-
Edited by Ashesheart: 3/10/2015 8:52:29 AMThanks for this example. It seems that it doesn't work with me :( the $redirect_url is empty so i think the curl_exec is not being executed with success. Edit : i'm testing it in a local environment (localhost)