MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / validateAuthHashMessage

Method validateAuthHashMessage

keepercommander/loginv3.py:1016–1035  ·  view source on GitHub ↗
(params: KeeperParams, encrypted_login_token_bytes)

Source from the content-addressed store, hash-verified

1014
1015 @staticmethod
1016 def validateAuthHashMessage(params: KeeperParams, encrypted_login_token_bytes):
1017
1018 rq = APIRequest_pb2.ValidateAuthHashRequest()
1019 rq.passwordMethod = APIRequest_pb2.PasswordMethod.Value("ENTERED")
1020
1021 rq.authResponse = params.auth_verifier
1022 rq.encryptedLoginToken = encrypted_login_token_bytes
1023
1024 api_request_payload = APIRequest_pb2.ApiRequestPayload()
1025 api_request_payload.payload = rq.SerializeToString()
1026
1027 rs = rest_api.execute_rest(params.rest_context, 'authentication/validate_auth_hash', api_request_payload)
1028
1029 if type(rs) == bytes:
1030 login_resp = APIRequest_pb2.LoginResponse()
1031 login_resp.ParseFromString(rs)
1032 return login_resp
1033 else:
1034 error_code = rs['error']
1035 raise KeeperApiError(error_code, 'Invalid email or password combination, please re-enter.' if error_code == 'auth_failed' else rs['message'] )
1036
1037 @staticmethod
1038 def twoFactorValidateMessage(params, # type: KeeperParams

Callers 1

verify_passwordMethod · 0.80

Calls 1

KeeperApiErrorClass · 0.85

Tested by

no test coverage detected