Skip to content

Commit 52da4c0

Browse files
committed
Add do_not_notify to get_session_token_verified and get_saml_assertion_verifying methods
1 parent cace7c3 commit 52da4c0

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/onelogin/api/client.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ def create_session_login_token(self, query_params, allowed_origin=''):
10111011
self.error = 500
10121012
self.error_description = e.args[0]
10131013

1014-
def get_session_token_verified(self, device_id, state_token, otp_token=None, allowed_origin=''):
1014+
def get_session_token_verified(self, device_id, state_token, otp_token=None, allowed_origin='', do_not_notify=False):
10151015
"""
10161016
10171017
Verify a one-time password (OTP) value provided for multi-factor authentication (MFA).
@@ -1028,6 +1028,9 @@ def get_session_token_verified(self, device_id, state_token, otp_token=None, all
10281028
:param allowed_origin: Required for CORS requests only. Set to the Origin URI from which you are allowed to send a request using CORS.
10291029
:type allowed_origin: string
10301030
1031+
:param do_not_notify: When verifying MFA via Protect Push, set this to true to stop additional push notifications being sent to the OneLogin Protect device.
1032+
:type do_not_notify: bool
1033+
10311034
Returns a session token
10321035
:return: return the object if success
10331036
:rtype: SessionTokenInfo
@@ -1046,7 +1049,8 @@ def get_session_token_verified(self, device_id, state_token, otp_token=None, all
10461049

10471050
data = {
10481051
'device_id': str(device_id),
1049-
'state_token': state_token
1052+
'state_token': state_token,
1053+
'do_not_notify': do_not_notify
10501054
}
10511055
if otp_token:
10521056
data['otp_token'] = otp_token
@@ -1448,7 +1452,7 @@ def get_saml_assertion(self, username_or_email, password, app_id, subdomain, ip_
14481452
self.error = 500
14491453
self.error_description = e.args[0]
14501454

1451-
def get_saml_assertion_verifying(self, app_id, device_id, state_token, otp_token=None, url_endpoint=None):
1455+
def get_saml_assertion_verifying(self, app_id, device_id, state_token, otp_token=None, url_endpoint=None, do_not_notify=False):
14521456
"""
14531457
14541458
Verify a one-time password (OTP) value provided for a second factor when multi-factor authentication (MFA) is required for SAML authentication.
@@ -1468,6 +1472,9 @@ def get_saml_assertion_verifying(self, app_id, device_id, state_token, otp_token
14681472
:param url_endpoint: Specify an url where return the response.
14691473
:type url_endpoint: string
14701474
1475+
:param do_not_notify: When verifying MFA via Protect Push, set this to true to stop additional push notifications being sent to the OneLogin Protect device
1476+
:type do_not_notify: bool
1477+
14711478
Returns a SAMLEndpointResponse object with an encoded SAMLResponse
14721479
:return: true if success
14731480
:rtype: SAMLEndpointResponse
@@ -1486,7 +1493,8 @@ def get_saml_assertion_verifying(self, app_id, device_id, state_token, otp_token
14861493
data = {
14871494
'app_id': app_id,
14881495
'device_id': str(device_id),
1489-
'state_token': state_token
1496+
'state_token': state_token,
1497+
'do_not_notify': do_not_notify
14901498
}
14911499

14921500
if otp_token:

0 commit comments

Comments
 (0)