@@ -188,6 +188,7 @@ class ClientApplication(object):
188188 "You can enable broker by following these instructions. "
189189 "https://msal-python.readthedocs.io/en/latest/#publicclientapplication" )
190190
191+
191192 def __init__ (
192193 self , client_id ,
193194 client_credential = None , authority = None , validate_authority = True ,
@@ -1712,11 +1713,10 @@ def _acquire_token_by_username_password_federated(
17121713 wstrust_endpoint .get ("action" ), self .http_client )
17131714 if not ("token" in wstrust_result and "type" in wstrust_result ):
17141715 raise RuntimeError ("Unsuccessful RSTR. %s" % wstrust_result )
1715- GRANT_TYPE_SAML1_1 = 'urn:ietf:params:oauth:grant-type:saml1_1-bearer'
17161716 grant_type = {
1717- SAML_TOKEN_TYPE_V1 : GRANT_TYPE_SAML1_1 ,
1717+ SAML_TOKEN_TYPE_V1 : self . client . GRANT_TYPE_SAML1_1 ,
17181718 SAML_TOKEN_TYPE_V2 : self .client .GRANT_TYPE_SAML2 ,
1719- WSS_SAML_TOKEN_PROFILE_V1_1 : GRANT_TYPE_SAML1_1 ,
1719+ WSS_SAML_TOKEN_PROFILE_V1_1 : self . client . GRANT_TYPE_SAML1_1 ,
17201720 WSS_SAML_TOKEN_PROFILE_V2 : self .client .GRANT_TYPE_SAML2
17211721 }.get (wstrust_result .get ("type" ))
17221722 if not grant_type :
@@ -2167,11 +2167,10 @@ def _acquire_token_by_iwa_federated(
21672167 wstrust_endpoint .get ("action" ), self .http_client )
21682168 if not ("token" in wstrust_result and "type" in wstrust_result ):
21692169 raise RuntimeError ("Unsuccessful RSTR. %s" % wstrust_result )
2170- GRANT_TYPE_SAML1_1 = 'urn:ietf:params:oauth:grant-type:saml1_1-bearer'
21712170 grant_type = {
2172- SAML_TOKEN_TYPE_V1 : GRANT_TYPE_SAML1_1 ,
2171+ SAML_TOKEN_TYPE_V1 : self . client . GRANT_TYPE_SAML1_1 ,
21732172 SAML_TOKEN_TYPE_V2 : self .client .GRANT_TYPE_SAML2 ,
2174- WSS_SAML_TOKEN_PROFILE_V1_1 : GRANT_TYPE_SAML1_1 ,
2173+ WSS_SAML_TOKEN_PROFILE_V1_1 : self . client . GRANT_TYPE_SAML1_1 ,
21752174 WSS_SAML_TOKEN_PROFILE_V2 : self .client .GRANT_TYPE_SAML2
21762175 }.get (wstrust_result .get ("type" ))
21772176 if not grant_type :
@@ -2185,6 +2184,7 @@ def _acquire_token_by_iwa_federated(
21852184 event ,
21862185 environment = self .authority .instance ,
21872186 username = username , # Useful in case IDT contains no such info
2187+ iwa = True
21882188 )),
21892189 ** kwargs )
21902190
0 commit comments