I've been trying to get Google's AuthSub authentication to work for me, but to no avail. I can get the token (see below) but I cannot use the token in any way.
-To get the token, the user clicks a link where href="https://www.google.com/accounts/AuthSubRequest? next=http%3A%2F %2Fdev.MyTestSi te.com%2F&scope =https%3A%2F%2F gdata.youtube.c om&session=1&se cure=0"
That redirects correctly with a token (which has more characters than any of their examples).
-HERE'S THE ISSUE: To turn the single use token into a session token, I've tried this:
This is returning a 401 Unauthorized error. When I look at the request in firebug, I don't see the correct request headers. Is there something that I'm doing wrong?
-To get the token, the user clicks a link where href="https://www.google.com/accounts/AuthSubRequest? next=http%3A%2F %2Fdev.MyTestSi te.com%2F&scope =https%3A%2F%2F gdata.youtube.c om&session=1&se cure=0"
That redirects correctly with a token (which has more characters than any of their examples).
-HERE'S THE ISSUE: To turn the single use token into a session token, I've tried this:
Code:
$.ajax({
url: "https://www.google.com/accounts/AuthSubSessionToken"
,headers: {
"Host": "www.google.com"
,"Content-Type": "application/x-www-form-urlencoded"
,"Authorization": authSub
,"User-Agent": "Java/1.5.0_06"
,"Accept": "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"
,"Connection": "keep-alive"}
,success:
function(data) {
alert('Data Loaded: ' + data);}
,type: 'GET'
,dataType: "jsonp"
,crossDomain: true
});
Comment