mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #39826 from cachedout/yubikey_fix
Add group func to yubikey auth
This commit is contained in:
commit
cbd2a4e3cc
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