Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #92 from AzureAD/demonstrating-api-version-usage-i…
Browse files Browse the repository at this point in the history
…n-samples

This is a straightforward change. Merging now.
  • Loading branch information
rayluo authored Jun 8, 2017
2 parents 963ce7d + 439b8af commit 93a85d9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sample/certificate_credentials_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_private_key(filename):
#uncomment for verbose logging
turn_on_logging()

context = adal.AuthenticationContext(authority_url)
context = adal.AuthenticationContext(authority_url, api_version=None)
key = get_private_key(sample_parameters['privateKeyFile'])

token = context.acquire_token_with_client_certificate(
Expand Down
3 changes: 2 additions & 1 deletion sample/client_credentials_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def turn_on_logging():
#turn_on_logging()

context = adal.AuthenticationContext(
authority_url, validate_authority=sample_parameters['tenant'] != 'adfs')
authority_url, validate_authority=sample_parameters['tenant'] != 'adfs',
api_version=None)

token = context.acquire_token_with_client_credentials(
RESOURCE,
Expand Down
2 changes: 1 addition & 1 deletion sample/device_code_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def turn_on_logging():
#uncomment for verbose logging
#turn_on_logging()

context = adal.AuthenticationContext(authority_url)
context = adal.AuthenticationContext(authority_url, api_version=None)
code = context.acquire_user_code(RESOURCE, clientid)
print(code['message'])
token = context.acquire_token_with_device_code(RESOURCE, code, clientid)
Expand Down
3 changes: 2 additions & 1 deletion sample/refresh_token_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def turn_on_logging():
#turn_on_logging()

context = adal.AuthenticationContext(
authority_url, validate_authority=sample_parameters['tenant'] != 'adfs')
authority_url, validate_authority=sample_parameters['tenant'] != 'adfs',
api_version=None)

token = context.acquire_token_with_username_password(
RESOURCE,
Expand Down
4 changes: 2 additions & 2 deletions sample/website_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def do_GET(self):
token_response = self._acquire_token()
message = 'response: ' + json.dumps(token_response)
#Later, if the access token is expired it can be refreshed.
auth_context = AuthenticationContext(authority_url)
auth_context = AuthenticationContext(authority_url, api_version=None)
token_response = auth_context.acquire_token_with_refresh_token(
token_response['refreshToken'],
sample_parameters['clientId'],
Expand All @@ -102,7 +102,7 @@ def _acquire_token(self):
cookie = Cookie.SimpleCookie(self.headers["Cookie"])
if state != cookie['auth_state'].value:
raise ValueError('state does not match')
auth_context = AuthenticationContext(authority_url)
auth_context = AuthenticationContext(authority_url, api_version=None)
return auth_context.acquire_token_with_authorization_code(
code,
REDIRECT_URI,
Expand Down

0 comments on commit 93a85d9

Please sign in to comment.