Skip to content

Commit

Permalink
Added support for client_secret for a bunch of methods
Browse files Browse the repository at this point in the history
  • Loading branch information
armicron committed Nov 25, 2017
1 parent 4d2f85d commit 515f786
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions warrant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ def confirm_sign_up(self,confirmation_code,username=None):
"""
if not username:
username = self.username
self.client.confirm_sign_up(
ClientId=self.client_id,
Username=username,
ConfirmationCode=confirmation_code
)
params = {'ClientId': self.client_id,
'Username': username,
'ConfirmationCode': confirmation_code}
self._add_secret_hash(params, 'SecretHash')
self.client.confirm_sign_up(**params)

def admin_authenticate(self, password):
"""
Expand Down Expand Up @@ -568,10 +568,12 @@ def initiate_forgot_password(self):
"""
Sends a verification code to the user to use to change their password.
"""
self.client.forgot_password(
ClientId=self.client_id,
Username=self.username
)
params = {
'ClientId': self.client_id,
'Username': self.username
}
self._add_secret_hash(params, 'SecretHash')
self.client.forgot_password(**params)


def delete_user(self):
Expand All @@ -595,12 +597,13 @@ def confirm_forgot_password(self, confirmation_code, password):
to retrieve a forgotten password
:param password: New password
"""
response = self.client.confirm_forgot_password(
ClientId=self.client_id,
Username=self.username,
ConfirmationCode=confirmation_code,
Password=password
)
params = {'ClientId': self.client_id,
'Username': self.username,
'ConfirmationCode': confirmation_code,
'Password': password
}
self._add_secret_hash(params, 'SecretHash')
response = self.client.confirm_forgot_password(**params)
self._set_attributes(response, {'password': password})

def change_password(self, previous_password, proposed_password):
Expand Down

0 comments on commit 515f786

Please sign in to comment.