mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
c234c25092
commit
6125eff02d
1 changed files with 5 additions and 4 deletions
|
@ -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'}}}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue