views:

149

answers:

4

(Sorry, noob question:) Is it possible to create a webapp on Google App Engine which can only be accessed by a single user? I'm thinking of a simple task management app for private usage.

Yes, I've already looked this up on the GAE docs, but I don't really understand what their domain based authentication system means.

Thanks in advance!

+3  A: 

"domain based authentication," once set up, causes the Web app to ask the user for a name and password. Without the proper credentials, he doesn't get access.

So this answers your question, and in the positive.

Carl Smotricz
+3  A: 

Of course. Just do

if(user.email() == myemail)

once the User object has been created.

Tom R
The "login: admin" option posted by Peter is a better solution. You don't have to worry about making sure all code paths do the check, and if you ever want to add a friend (or a cronjob, or task queue) you don't have to go modifying code :-)
Danny Tuppeny
+2  A: 

If by "single user" you mean only you will ever use the app, the simplest option is to configure the application to do the authentication for you. In python this would be done using the app.yaml file, as shown here. This way you can lock down a number of urls all at the same time. Using the admin option would be appropriate if only you were to be allowed access, and the "required" option would work if you wanted others to be able to log in as well.

Sample of what the yaml would like:

handlers:

- url: /profile/.*
  script: user_profile.py
  login: required

- url: /admin/.*
  script: admin.py
  login: admin

- url: /.*
  script: welcome.py
Peter Recore
A: 

or... simply, you can create a new app with a ridiculous name like ty78347dee345.appspot.com and keep it a secret, just like you do with your email password.

Gaurav
If you have outgoing links, this address might soon end up in someones unprotected web logs as a referer, and then found by search engines. I wouldn't rely on this method!
Danny Tuppeny