@@ -239,6 +239,7 @@ class ClientApplication(object):
239239 "You can enable broker by following these instructions. "
240240 "https://msal-python.readthedocs.io/en/latest/#publicclientapplication" )
241241
242+
242243 def __init__ (
243244 self , client_id ,
244245 client_credential = None , authority = None , validate_authority = True ,
@@ -1889,11 +1890,10 @@ def _acquire_token_by_username_password_federated(
18891890 wstrust_endpoint .get ("action" ), self .http_client )
18901891 if not ("token" in wstrust_result and "type" in wstrust_result ):
18911892 raise RuntimeError ("Unsuccessful RSTR. %s" % wstrust_result )
1892- GRANT_TYPE_SAML1_1 = 'urn:ietf:params:oauth:grant-type:saml1_1-bearer'
18931893 grant_type = {
1894- SAML_TOKEN_TYPE_V1 : GRANT_TYPE_SAML1_1 ,
1894+ SAML_TOKEN_TYPE_V1 : self . client . GRANT_TYPE_SAML1_1 ,
18951895 SAML_TOKEN_TYPE_V2 : self .client .GRANT_TYPE_SAML2 ,
1896- WSS_SAML_TOKEN_PROFILE_V1_1 : GRANT_TYPE_SAML1_1 ,
1896+ WSS_SAML_TOKEN_PROFILE_V1_1 : self . client . GRANT_TYPE_SAML1_1 ,
18971897 WSS_SAML_TOKEN_PROFILE_V2 : self .client .GRANT_TYPE_SAML2
18981898 }.get (wstrust_result .get ("type" ))
18991899 if not grant_type :
@@ -2387,11 +2387,10 @@ def _acquire_token_by_iwa_federated(
23872387 wstrust_endpoint .get ("action" ), self .http_client )
23882388 if not ("token" in wstrust_result and "type" in wstrust_result ):
23892389 raise RuntimeError ("Unsuccessful RSTR. %s" % wstrust_result )
2390- GRANT_TYPE_SAML1_1 = 'urn:ietf:params:oauth:grant-type:saml1_1-bearer'
23912390 grant_type = {
2392- SAML_TOKEN_TYPE_V1 : GRANT_TYPE_SAML1_1 ,
2391+ SAML_TOKEN_TYPE_V1 : self . client . GRANT_TYPE_SAML1_1 ,
23932392 SAML_TOKEN_TYPE_V2 : self .client .GRANT_TYPE_SAML2 ,
2394- WSS_SAML_TOKEN_PROFILE_V1_1 : GRANT_TYPE_SAML1_1 ,
2393+ WSS_SAML_TOKEN_PROFILE_V1_1 : self . client . GRANT_TYPE_SAML1_1 ,
23952394 WSS_SAML_TOKEN_PROFILE_V2 : self .client .GRANT_TYPE_SAML2
23962395 }.get (wstrust_result .get ("type" ))
23972396 if not grant_type :
@@ -2405,6 +2404,7 @@ def _acquire_token_by_iwa_federated(
24052404 event ,
24062405 environment = self .authority .instance ,
24072406 username = username , # Useful in case IDT contains no such info
2407+ iwa = True
24082408 )),
24092409 ** kwargs )
24102410
0 commit comments