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

Demonstrating how to properly set api_version=None in all samples #92

Merged
merged 1 commit into from
Jun 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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