Add group func to yubikey auth

Because we don't support groups with yubikeys (and can't, in fact)
we need to dummy up this to always return false. This allows individual
user auths to work, whereas they would fail prior to this change.
This commit is contained in:
Mike Place 2017-03-03 16:46:24 -07:00
parent c234c25092
commit 6125eff02d
No known key found for this signature in database
GPG key ID: 9136F4F13705CFD3

View file

@ -78,15 +78,16 @@ def auth(username, password):
client = Yubico(_cred['id'], _cred['key'])
try:
if client.verify(password):
return True
else:
return False
return client.verify(password)
except yubico_exceptions.StatusCodeError as e:
log.info('Unable to verify YubiKey `{0}`'.format(e))
return False
def groups(username, *args, **kwargs):
return False
if __name__ == '__main__':
__opts__ = {'yubico_users': {'damian': {'id': '12345', 'key': 'ABC123'}}}