>
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
>
> auth.settings.login_methods.append(ldap_auth(mode='ad',
>    server='my.domain.controller',
>    base_dn='ou=Users,dc=domain,dc=com'))
>
>
> But my question is do I still have to keep the following lines ? 
>
> from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
> auth = Auth(db, hmac_key = Auth.get_or_create_key())
>
> What is auth = Auth(db, hmac_key = Auth.get_or_create_key()) actually does 
> ? If i comment those line, I got error saying that auth is not defined.
>

auth = Auth(...) defines the Auth object -- you must do that if you want to 
use the Auth system. The LDAP code above references auth, so it must be 
created before it is referenced. You do not necessarily need Crud, Service, 
or PluginManager (you do not need them at all for Auth).

Anthony
 

-- 



Reply via email to