JavaScript is required to use Bungie.net

Group Avatar

BungieNetPlatform

"Updates, discussions, and documentation of the BungieNetPlatform API."

Request Join
originally posted in:BungieNetPlatform
11/11/2014 4:19:02 PM
1

Php Code for Web Test - Auth Example

Ok, not sure if helpful but probably beneficial to some on future development... only reason I wrote this was I read a previous post on Python and thought I could do it with php fairly simple... This might help some idk, and I may be wasting time even posting, but oh well.. [quote]//Uh, if your reading this, should thank ol' Strik3 here. //This lil snippet gets to auth logins for all 4 required by Bungie // Not sure if needed, but lets send this header incase the ass taxi page wants it - simple tell the page where a legit response from a browser or what not $useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1"; //can set this to a $_POST and do a switcharoo for testing - simple msn login for now $destination = "MSN"; switch ($destination){ case "Facebook": $url = "http://www.bungie.net/en/User/SignIn/Facebook?bru=%252f"; break; case "Google": $url = "http://www.bungie.net/en/User/SignIn/Google?bru=%252f"; break; case "MSN": $url = "http://www.bungie.net/en/User/SignIn/Wlid?bru=%252f"; break; case "PSN": $url = "http://www.bungie.net/en/User/SignIn/Psnid?bru=%252f"; break; default: $url = "http://www.bungie.net/en/User/SignIn/Wlid?bru=%252f"; break; } // lets fire up the curl and see if the mother humper puts out.. always hoping for a put out.... $ch = curl_init(); //ok, now need to set the header goto our destination, and follow the response... we dont need no stinking SSL, just send me to the login script...don't have all day curl_setopt($ch, CURLOPT_USERAGENT, $useragent); curl_setopt ($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_exec ($ch); //end the curl set it to a variable and display curl_close ($ch); $result = curl_exec ($ch); echo "<PRE>".htmlentities($result); //from here we could do step #2 and send the form data and auto.. need to set POST data for the entries tho.. Ill put it on my todo list... ?>[/quote]

Posting in language:

 

Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

View Entire Topic
  • I think with what you're planning for step two is a little different, at least to the way I did it. What I do is to first authenticate with the external provider (ie. Google), then hang on to the cookies from the response. Then, when it's time to authenticate with bungie.net, I just make the request to the sign in link (the ones you have listed), let the redirects do the work, and then hold on to the cookies bungie.net sets (bungleatk, bungled, etc...).

    Posting in language:

     

    Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

You are not allowed to view this content.
;
preload icon
preload icon
preload icon