ozwyzard
unread,Nov 21, 2012, 5:48:13 PM11/21/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to turbo...@googlegroups.com
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.