Hi Jeff,
I am using Python, and managed to get it to work by using the
following.
client = gdata.service.GDataService()
# Tell the client that we are running in single user mode,
and it should not
# automatically try to associate the token with the current
user then store
# it in the datastore.
gdata.alt.appengine.run_on_appengine(client,
store_tokens=False,
single_user_mode=True)
client.email = MY_EMAIL_HERE
client.password = NOT_FOR_YOUR_EYES
# To request a ClientLogin token you must specify the
desired service using
# its service name.
client.service = 'analytics'
# Request a ClientLogin token, which will be placed in the
client's
# current_token member.
client.ProgrammaticLogin()
auth_key_for_analytics_to_use_in_header =
client.current_token
This lead me to believe that it's actually not the Auth-header that
there's anything wrong with in the production environment, but rather
picking up the correct Auth when utilizing app engine. However the
above solved my problem, and I was able to get to the analytics api
without an auth error.
On Apr 22, 6:37 pm, "Jeff S (Google)" <[email protected]> wrote:
> Hi tijer,
>
> I should be possible to set the authorization header. Are you using the Java
> runtime or Python.
>
> For Java, I looked at the gdata-java-client as an example (since you can use
> this library on App Engine) and it uses
>
> httpConn.setRequestProperty(name, value);
> Where httpConn is an HttpURLConnection.
>
> To set the Authorization header (this was in
> /trunk/java/src/com/google/gdata/client/http/HttpGDataRequest.java). If you
> feel like using the existing Java library for the Analytics API, a new
> download has just been released which includes convenience classes for this
> API.
>
> Happy coding,
>
> Jeff
>
>
>
> On Tue, Apr 21, 2009 at 6:32 PM, tijer <[email protected]> wrote:
>
> > Hi, I'm trying to use the new Google Analytics API with App Engine.
>
> > It works great on the development server locally, but as soon as I
> > upload it to the production environment the authorization doesn't seem
> > to go through.
>
> > I callhttps://www.google.com/accounts/ClientLoginas specified in the
> > api, then I pull the Auth= part and add it to an Authorization header
> > that calls Google Analytics for a crosscut of data.
>
> > It works in the development server, but when I do the same in the
> > production environment I get the Auth= token from
> >https://www.google.com/accounts/ClientLoginjust fine, but as soon as
> > I call Analytics using the token I get an error that the Authorization
> > did not come through.
>
> > Is the Authorization header disabled in the production environment? Or
> > how do I solve this problem?
>
> > Thx
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---