1
votes

I have been trying to get public albums from google's web albums API for Picasa.

I am able to successfully get an access token, but when I send it from my server to google I get an "Token invalid - AuthSub token has wrong scope" error.

I've played around a bit, and also gotten an "Unknown authorization header" error also.

What scope do I use for Picasa API? I'm using "profile." Here is my code:

Edit: No longer getting the Token invalid error, now only "unknown authorization header". I changed the scope from "profile" to the proper picasa scope.

Am I not setting my header right?

                     $.ajax({ 
                url: serverURL, //pass data to server
                type: "GET",

                data: {Authorization : access_token},
                success: function(){
                    console.log("success");
                },
                fail: function(){
                    console.log("fail");
                }
            })
            .done(function(data){
                console.log(data);
            });

And my asp:

    x = Request.Form("Authorization")
    Set f_oXMLHTTP = Server.CreateObject("msxml2.ServerXMLHTTP")
    f_oXMLHTTP.SetTimeOuts 10000, 10000, 120000, 120000

    f_sUrl = "http://picasaweb.google.com/data/feed/api/user/default?v=2"

    f_oXMLHTTP.Open "GET", f_sUrl, False
    f_oXMLHTTP.setRequestHeader "Authorization", "Bearer " & x 'sent Bearer and and token'
    f_oXmlHttp.Send

    Response.Write(f_oXMLHTTP.ResponseText) 'response from google'
1
I've tried using both POST and GET. - KardJaster

1 Answers

0
votes

Simple fix..

x = Request.QueryString("Authorization") stores the actual string.

Google requires authorization to be a string.