Hello, I am trying to use two factor authentication for my entire app so I 
have my model like this:

db = DAL('sqlite://database.db', migrate_enabled=False, lazy_tables=True)
auth = Auth(db)
auth.define_tables(username=True, signature=True)
auth.settings.actions_disabled.append('register')
auth.settings.auth_two_factor_enabled = True
auth.settings.extra_fields['auth_user'] = [Field('motp_secret', 'password', 
length=512, default='', label='MOTP Secret')]

def _set_two_factor(user, auth_two_factor):
    return None

def verify_otp(user, otp):
    import pyotp
    totp = pyotp.TOTP(user.motp_secret)
    return totp.verify(int(otp))

auth.settings.two_factor_methods = [lambda user, auth_two_factor: 
_set_two_factor(user, auth_two_factor)]
auth.settings.two_factor_onvalidation = [lambda user, otp: verify_otp(user, 
otp)]


Buy when I try to load my site it gives a ticket which says: setting key 
'auth_two_factor_enabled' does not exist

What am I doing wrong?
Can anyone help me?

Thank you in advance.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to