Hello,
I am trying LDAP Authentication with turbogears 2.
LDAP Authentication working with tg 2
LDAP users can able to login using the tg2 login form.
But when the local users in the sqlalchemy database trying to login, i
showing error Cannot add metadata

2010-08-04 18:05:52,322 -- repoze.who request started (/login_handler)
--
2010-08-04 18:05:52,322 request classification: browser
2010-08-04 18:05:52,323 identifier plugins registered
[<FriendlyFormPlugin 168144588>, <AuthTktCookiePlugin 168144652>]
2010-08-04 18:05:52,323 identifier plugins matched for classification
"browser": [<FriendlyFormPlugin 168144588>, <AuthTktCookiePlugin
168144652>]

2010-08-04 18:05:52,323 identity returned from <FriendlyFormPlugin
168144588>: {'login': 'manu', 'password': '123456'}
2010-08-04 18:05:52,324 no identity returned from <AuthTktCookiePlugin
168144652> (None)
2010-08-04 18:05:52,324 identities found: [(<FriendlyFormPlugin
168144588>, {'login': 'manu', 'password': '123456'})]
2010-08-04 18:05:52,324 authenticator plugins registered
[<LDAPAuthenticatorPlugin 168144684>,
<repoze.who.plugins.sa.SQLAlchemyAuthenticatorPlugin object at
0xa036fac>]
2010-08-04 18:05:52,324 authenticator plugins matched for
classification "browser": [<LDAPAuthenticatorPlugin 168144684>,
<repoze.who.plugins.sa.SQLAlchemyAuthenticatorPlugin object at
0xa036fac>]

2010-08-04 18:05:52,326 userid returned from <LDAPAuthenticatorPlugin
168144684>: "uid=manu,dc=localhost,dc=localdomain"
/root/tg2env/lib/python2.4/site-packages/SQLAlchemy-0.5.6-py2.4.egg/
sqlalchemy/engine/default.py:230: SAWarning: Unicode type received non-
unicode bind param value 'manu'
  param.append(processors[key](compiled_params[key]))
2010-08-04 18:05:52,333 userid returned from
<repoze.who.plugins.sa.SQLAlchemyAuthenticatorPlugin object at
0xa036fac>: "manu"
2010-08-04 18:05:52,333 identities authenticated: [((0, 0),
<LDAPAuthenticatorPlugin 168144684>, <FriendlyFormPlugin 168144588>,
{'login': 'manu', 'password': '123456', 'repoze.who.userid': 'manu'},
u'uid=manu,dc=localhost,dc=localdomain'), ((1, 0),
<repoze.who.plugins.sa.SQLAlchemyAuthenticatorPlugin object at
0xa036fac>, <FriendlyFormPlugin 168144588>, {'login': 'manu',
'password': '123456', 'repoze.who.userid': 'manu'}, 'manu')]
2010-08-04 18:05:52,335 Cannot add metadata: {'info': 'invalid DN',
'desc': 'Invalid DN syntax'}
----------------------------------------
Exception happened during processing of request from ('127.0.0.1',
44689)
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Paste-1.7.4-py2.4.egg/paste/
httpserver.py", line 1068, in process_request_in_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.4/SocketServer.py", line 254, in
finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.4/SocketServer.py", line 521, in __init__
    self.handle()
  File "/usr/lib/python2.4/site-packages/Paste-1.7.4-py2.4.egg/paste/
httpserver.py", line 442, in handle
    BaseHTTPRequestHandler.handle(self)
  File "/usr/lib/python2.4/BaseHTTPServer.py", line 316, in handle
    self.handle_one_request()
  File "/usr/lib/python2.4/site-packages/Paste-1.7.4-py2.4.egg/paste/
httpserver.py", line 437, in handle_one_request
    self.wsgi_execute()
  File "/usr/lib/python2.4/site-packages/Paste-1.7.4-py2.4.egg/paste/
httpserver.py", line 287, in wsgi_execute
    self.wsgi_start_response)
  File "/usr/lib/python2.4/site-packages/repoze.who-1.0.18-py2.4.egg/
repoze/who/middleware.py", line 85, in __call__
    self.add_metadata(environ, classification, identity)
  File "/usr/lib/python2.4/site-packages/repoze.who-1.0.18-py2.4.egg/
repoze/who/middleware.py", line 179, in add_metadata
    plugin.add_metadata(environ, identity)
  File "/usr/lib/python2.4/site-packages/repoze.who.plugins.ldap-1.1a1-
py2.4.egg/repoze/who/plugins/ldap/plugins.py", line 435, in
add_metadata
    raise Exception(identity)
Exception: <repoze.who identity (hidden, dict-like) at 171482252>

**********************  who.ini

[plugin:friendlyform]
use = repoze.who.plugins.friendlyform:FriendlyFormPlugin
login_form_url= /login
login_handler_path = /login_handler
logout_handler_path = /logout_handler
rememberer_name = auth_tkt
post_login_url = /post_login
post_logout_url =

[plugin:auth_tkt]
use = repoze.who.plugins.auth_tkt:make_plugin
secret = something

[plugin:ldap_auth]
use = repoze.who.plugins.ldap:LDAPAuthenticatorPlugin
ldap_connection = ldap://127.0.0.1
base_dn = dc=localhost,dc=localdomain

[plugin:ldap_attributes]
use = repoze.who.plugins.ldap:LDAPAttributesPlugin
ldap_connection = ldap://127.0.0.1

[plugin:sa_auth]
use = repoze.who.plugins.sa:make_sa_authenticator
user_class = myproject.model:User
dbsession = myproject.model:DBSession

[plugin:sa_mdp]
use = repoze.who.plugins.sa:make_sa_user_mdprovider
user_class = myproject.model:User
dbsession = myproject.model:DBSession

[general]
request_classifier = repoze.who.classifiers:default_request_classifier
challenge_decider = repoze.who.classifiers:default_challenge_decider

[identifiers]
plugins =
    friendlyform;browser
    auth_tkt

[authenticators]
plugins =
        ldap_auth
        sa_auth

[challengers]
plugins =
    friendlyform;browser

[mdproviders]
plugins =
        ldap_attributes
        sa_mdp

------------------------

-- 
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.

Reply via email to