Skip to content

Commit

Permalink
Merge pull request #35 from AzureAD/client_cert_flow_changes
Browse files Browse the repository at this point in the history
Adding client assertion type
  • Loading branch information
rayluo committed Apr 11, 2019
2 parents f092ebe + 51a650c commit 16db2d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions msal/application.py
Expand Up @@ -108,6 +108,7 @@ def __init__(

def _build_client(self, client_credential, authority):
client_assertion = None
client_assertion_type = None
default_body = {"client_info": 1}
if isinstance(client_credential, dict):
assert ("private_key" in client_credential
Expand All @@ -117,6 +118,7 @@ def _build_client(self, client_credential, authority):
sha1_thumbprint=client_credential.get("thumbprint"))
client_assertion = signer.sign_assertion(
audience=authority.token_endpoint, issuer=self.client_id)
client_assertion_type = Client.CLIENT_ASSERTION_TYPE_JWT
else:
default_body['client_secret'] = client_credential
server_configuration = {
Expand All @@ -135,6 +137,7 @@ def _build_client(self, client_credential, authority):
},
default_body=default_body,
client_assertion=client_assertion,
client_assertion_type=client_assertion_type,
on_obtaining_tokens=self.token_cache.add,
on_removing_rt=self.token_cache.remove_rt,
on_updating_rt=self.token_cache.update_rt,
Expand Down

0 comments on commit 16db2d7

Please sign in to comment.