Authsub: Token invalid - AuthSub token has wrong scope
228 views
Skip to first unread message
mschenkel
unread,
Oct 21, 2009, 10:51:15 AM10/21/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-analytics-api - GA Data Export API
I have been fighting with this for hours. As far as I know, I have a
proper long-lived token. But any feed I try to get results in this
error message. I did some searching on this forum and this thread
seems exaclty what I am experiencing:
These work. So it obviously must be something in my code or a
header. Probably best thing now is to use an application like fiddler
to see exactly what is going on.
Nick
unread,
Oct 21, 2009, 4:20:09 PM10/21/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-analytics-api - GA Data Export API
Yes, looking at headers is usually the best way to debug.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-analytics-api - GA Data Export API
To mix things up, I just tried the same with the Calendar. I get the
same thing.
This is definitely a problem with requesting the feeds and not the
authentication right? I have verified I have granted access in the
google settings.
Couple other things:
I am doing this in a test environment. I have changed my host file to
simulate that I am on my site (i.e. within my browser). Does this
matter? Or do I have to have this running on the true domain?
Thanks.
mschenkel
unread,
Oct 22, 2009, 10:21:47 AM10/22/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-analytics-api - GA Data Export API
Ok - I have done some more hashing on this. I believe it has
something to do with the SSL. I have gotten it to work with the
calendar feed:
Once the user, grants access, they will be redirected to the URL in
the next parameter and the redirect will add a parameter named "token"
in the URL. This is only good for 1 request. You can use this 1
request to upgrade the token to a long lived one. It's the long lived
token that needs to go into the header of the requests to the GA API.
-Nick
On Oct 22, 10:21 am, mschenkel wrote:
> Ok - I have done some more hashing on this. I believe it has
> something to do with the SSL. I have gotten it to work with the
> calendar feed:
>
> GET /calendar/feeds/default/allcalendars/full?
> gsessionid=uFOd8WRGtCIC5vBt3eGwmg HTTP/1.1
> Authorization: AuthSub token="CP_xxxxxxxxxxx"
> Host:www.google.com > Accept: text/html, */*
> Accept-Encoding: identity
> User-Agent: Mozilla/3.0 (compatible; Indy Library)
> Cookie: S=calendar=uFOd8WRGtCIC5vBt3eGwmg
>
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-analytics-api - GA Data Export API
Yes - I understand this. And have followed these steps (many times in
fact). You seem to be indicating I have an incorrect token. BUT,
with this token I am able to successfully query the calendar feed. Is
it possible the token will work for the calendar but not GA, even
though during my AuthSubRequest and subsequent request for long-lived
tokens I requested access for both services? I have checked my Google
Account settings - I have access granted to my website for both.
mschenkel
unread,
Oct 23, 2009, 1:30:27 PM10/23/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-analytics-api - GA Data Export API
Perhaps this is the problem: if the google feed is SSL (i.e. calls
https://www.google.....) do I need a certificate????
Currently I am not using a certificate, I will give this a try now.