> Has anyone implemented "single sign on" functionality? If this has a bug I'll report it here, but it appears to be working:
Move all of your application-specific table defs out of db.py if you haven't already done so. This should leave you with the basic application setup and auth file generation. Your applications will all have to share user_auth, at least. All your apps have to share the tables. If you're using sqlite, each app by default has a unique set of tables. Since I use *nix boxen, I guess I could have softlinked the database directories to the table files in the master app's database directory. Since I'm going to use Postgresql in production, I just switched to it. Thanks to Massimo or whoever wrote the steps for using Postgresql, by the way. Worked like a charm. In your master app's db.py file, add a session.connect() as described in chapter 4 of the book, under 'Cooperation.' I have it right after the line of code that instantiates db. Do the same thing in each of your other db.py files. Then add these lines of code underneath it: if not session.auth: session.original_request = { 'application': request.application, 'controller': request.controller, 'function': request.function, 'args': request.args, 'vars': request.vars } redirect(URL('welcome', 'default', 'user/login')) Notice I am using the welcome app as my master. This I will change today because otherwise upgrades will cause a problem. In the welcome app, the login function redirects to welcome/default/ index I put these lines of code at the very top if the index function: if session.original_request: destination = URL( session.original_request['application'], session.original_request['controller'], session.original_request['function'], args = session.original_request['args'], vars = session.original_request['vars'], ) del session['original_request'] redirect(destination) On Sep 21, 2:07 pm, pbreit <pbreitenb...@gmail.com> wrote: > Has anyone implemented "single sign on" functionality? That might be a good > utility to have available.