JavaScript is required to use Bungie.net

Group Avatar

BungieNetPlatform

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

Request Join
originally posted in:BungieNetPlatform
1/20/2015 7:07:38 PM
2

Authentication with Mac OS/iOS Cocoa

I'm currently trying to figure out manual authentication via the Mac OSX SDK. No matter what I do, the JSON response always returns an error of "WebAuthRequired" and "Please sign-in to continue". I've followed the instructions in the API introduction post but am getting nowhere. Here is what I have so far: //<character ID> is replaced with one of my own character IDs. //the vendor hash for gunsmith is outlined on a separate wiki NSURL *url = [NSURL URLWithString:@"http://www.bungie.net/platform/Destiny/1/MyAccount/Character/<characterID>/Vendor/570929315<gunsmith>/"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; [request setHTTPMethod:@"GET"]; [request setValue:@"www.bungie.net" forHTTPHeaderField:@"Host"]; [request setValue:@"keep-alive" forHTTPHeaderField:@"Connection"]; [request setValue:@"<my api key>" forHTTPHeaderField:@"X-API-Key"]; [request setValue:@"bungledid=<bungledid cookie value>; bungled=<bungled cookie value>" forHTTPHeaderField:@"Cookie"]; //both cookies are obtained by inspecting cookies on a private browsing session [NSURLConnection connectionWithRequest:request delegate:self]; After retrieving the contents of the request it's always the error message. Please help!

Posting in language:

 

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

  • If you still need help with this email me at szhlopp@gmail.com and I can show you. I've written an almost complete framework that authenticates via Live credentials (your xbox account).

    Posting in language:

     

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

  • To do what you want you need to authenticate with an external provider first (ie. Microsoft Accounts, Google Accounts, Facebook, PSN) and hold on to the cookies which you then use in future requests to identify the account.

    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