Google AuthSubSessionToken, 401 Unauthorized

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

If you're getting a "401 Unauthorized" response from Google when trying to exchange your single-use token for a long-term session token, then point your HTTP request at something that will show you your request headers (for instance something with phpinfo() in it for PHP) and make sure your Authorization: AuthSub token="token" header is actually being sent.

If you're using cURL and PHP, make sure that you're passing an array with the CURLOPT_HTTPHEADER key to curl_setopt and not a string or else cURL will ignore it.

Good


PHP Code: [ Select ]
curl_setopt($connection, CURLOPT_HTTPHEADER, array('Authorization: AuthSub token="token"'));


Bad


PHP Code: [ Select ]
curl_setopt($connection, CURLOPT_HTTPHEADER, 'Authorization: AuthSub token="token"');


Feel free to assume I didn't just spend an hour figuring this out. :D

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 85 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.