I put some debugging hacks in setup_auth() and figured out that since I am configuring authenticators in app_cfg.py, with the tg 2.2 auth layer, the SQLAlchemyAuthenticatorPlugin() is not instantiated in add_auth_middleware(). Hence, (a) it does not consume some of the auth_args, and (b) the authenticate function is not called for friendlyformplugin logins.
Since the logic in setup_auth() relies on either **all** or **no** authenticators configured, I would have to instantiate the SQLAlch authenticator myself and configure it in base_config but then I would have to do surgery on the auth_args (kw arg), and even then AppConfig automatically creates a self.sa_auth.translations parameter (which would choke PluggableAuthenticationMiddleware(). One alternative is to modify either setup_auth() or add_auth_middleware() to handle the above scenario. On Monday, November 26, 2012 2:33:33 PM UTC-8, ozwyzard wrote: > > Thank you. I would not have figured that out. > > When I set base_config.sa_auth.authmetadata = None, I see a param mismatch > exception when PluggableAuthenticationMiddleware's __init__() is called. > > In /tg/configuration/app_config.py::add_auth_middleware() > *if 'authmetadata' not in auth_args: > calls setup_sql_auth() .. consumes permission_class and translations > etc. and in turn calls setup_auth() such that when it calls > PluggableAuthenticationMiddleware() the parameters match > else: > calls setup_auth() with auth_args .. and > PluggableAuthenticationMiddleware() chokes on invalid parameters > permission_class, dbsession, translations, etc. > * > > > I will debug further.. > > -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To view this discussion on the web visit https://groups.google.com/d/msg/turbogears/-/A9YgY9wGlUQJ. 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/turbogears?hl=en.

