If you remove the base_config.sa_auth.authmetadata field you just disable the 2.2 auth layer and fall back to the repoze.what-quickstart one, that is why you get the SQLAlchemyUserMDPlugin registered.
To use the the new auth setup but skip the default TG metadata provider just set authmetadata to None. On Wed, Nov 21, 2012 at 11:48 PM, ozwyzard <[email protected]> wrote: > > I have a custom Auth Plugin with an IMetadataProvider (add_metadata()) > that sets the identity['user'] to a custom record. > > However, by the time the call reaches the __before of a controller, the > repoze.who.identity['user'] is scribbled over by other auth plugins and set > to None. > > The plugins in question are SQLAlchemyUserMDPlugin() for sure and possibly > AuthorizationMetadata(). > > I am using TG2.2 with repoze.who-2.0-py2.7, but not using the "class > ApplicationAuthMetadata(TGAuthMetadata)" in app_cfg.py, instead just the > simple config like so: > > base_config.sa_auth.identifiers = [('api',ApiClientAuthPlugin), > ('browser',BrowserClientAuthPlugin), ('oauth2_browser', > OAuth2ClientPlugin)] > base_config.sa_auth.challengers = [('api',ApiClientAuthPlugin), > ('oauth2_browser',OAuth2ClientPlugin)] > base_config.sa_auth.group_class = model.Group > base_config.sa_auth.permission_class = model.Permission > base_config.sa_auth.authenticators = > [('browser',BrowserClientAuthPlugin), ('oauth2_browser',OAuth2ClientPlugin)] > base_config.sa_auth.mdproviders = > [('oauth2_browser',OAuth2ClientPlugin)] > base_config.sa_auth.form_plugin = None > > The SQLAlchemyUserMDPlugin() gets registered as a plugin in > repoze.what.quickstart-1.0.9-py2.7.egg/repoze/what/plugins/quickstart/__init__.py::setup_sql_auth(). > > What am I doing wrong? > > Thanks. > > -- > 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/-/FSFadAlm6SwJ. > 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. > -- You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en.

