Question

I'm currently developing a bottle app on GAE, and it's already got its own home-made authentication system. However, I would also like to permit access to some areas to application admins using Google Accounts. I'm looking at the documentation, but I'm not quite following it.

On the development server, hiting any _ah link sends me straight to the desired page, but on GAE, it gives me bottle's own 404 page. Can you point me to the right page where I can get started with this (preferably not the official docs which I'm having hard time with)?

NOTE: Forgot to mention it's a Python version of GAE.

Was it helpful?

Solution

_ah will work only on the development server. It's a part of appengine sdk which emulates the GAE. Coming to your point. If you want to use the google's account for admin functionalities. Then you should do something like this

from google.appengine.api import users

if users.is_current_user_admin():

Here admin refers to the appengine admin. if you want to simply use the google authentication then you should use users.get_current_user() to get the current logged in user and implement your own logic.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top