Hi Giacomo, I think I've spotted the issue. The appendix section in this article explains how to use ClientLogin on App Engine:
http://code.google.com/appengine/articles/gdata.html If you change your run_on_appengine call to this, you should be able to get the documents feed without requiring the end user to sign in: gdata.alt.appengine.run_on_appengine(gd_client, store_tokens=False, single_user_mode=True) With that change you can remove the auto-signin code which you pointed out above. You should no longer need to check to see if the user is signed in to your app. Happy coding, Jeff On Nov 14, 2:47 am, Giacomo Cucciati <[EMAIL PROTECTED]> wrote: > Hi Jeff! > > Ok! The application is similar to which you have described. > A web page should show my documents list (the title of the documents) > and each item of the list is a link to the an other web page that > embeds the document content. Everyone should be able to view my list > and the contents (it should be public). > > I'll try to explain better my problem :) > > To retrive my document list and the documents contents, an external > user has to know my global account's credentials. As you have said i > have embedded them in the code so theoretically everyone can see the > document list... here it is the code: > > gd_client = gdata.docs.service.DocsService() > gdata.alt.appengine.run_on_appengine(gd_client) > gd_client.ClientLogin('my- > [EMAIL PROTECTED]','mypassword') > feed = gd_client.GetDocumentListFeed() > > Thanks to the feed i can obtain everything about the documents. > > The problem is: when someone tries to enter in this web page an error > page occours with this message: Authorization required. > Apparently the application required the user to be logged in. Infact > when i have inserted first of all in the code a login to the app > through the method explained in the "Getting started guide: Using the > Users Service"... > > user = users.get_current_user() > > if user: > self.response.out.write(template.render('mySite.html',values)) > else: > self.redirect(users.create_login_url(self.request.uri)) > > ...it started working! But in this way, if an external user runs my > application, it asks him to login with his google account and then he > redirect to my web page and he really is able to view my document list > and doc contents. > So my application isn't public because a google account (and a login > to my app) is required. > > I think that a solution could be avoiding this login or create a fake > user (with mail and pass already inserted in the code) but i haven't > found a way to do this. > > I hope it's a bit clear now. > I don't know where the login request comes from. There isn't a > login:required mark in the app.yaml. > > Thank you!!! > > Giacomo > > On 13 Nov, 18:30, Jeff S <[EMAIL PROTECTED]> wrote: > > > > > Hi Giacomo, > > > I want to make sure I've understood your design. You said you want a > > page listing your Google Docs, and this listing page would not require > > users to log in, in other words, it is public. Do you want everyone to > > be able to view the doc content as well? This should be doable if you > > are using client login and embedding the global account's credentials > > in the code. > > > If your app is asking users to log in, then the cause may be that a > > URL is marked login:required in app.yaml, or perhaps a request handler > > is automatically redirecting to a sign in page. I might be able to get > > a better idea if I could look at some of your code. > > > Thank you, > > > Jeff > > > On Nov 12, 12:22 am, Giacomo Cucciati <[EMAIL PROTECTED]> > > wrote: > > > > Hi all! > > > > I have a problem linked to the user login... > > > > My web application should work in this way: > > > -an external user visits my web page were there are some links > > > -each of these shows a list of my documents (using Docs API) > > > -each doc title, shown in the list, is a link to the doc content > > > > Now, when i have updated my application (by appcfg.py command) I have > > > seen > > > that an external user has to login with his google account whene he > > > clicks on a link to obtain > > > just the list of my docs, otherwise an authentication error occours. > > > The credentials of my account for the client login (mail and password) > > > are inserted in the code so it isn't their fault. > > > I know there is the users.create_login_url(self.request.uri) > > > function... but is there a way to avoid the user login page or to > > > create a fake user (to insert in the code as the previous one) so that > > > everyone can see my document list? > > > > I'm not sure to have explaned clearly the problem... > > > > Thank you! > > > > Giacomo --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
