Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Modified AuthenticationContext #65

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jinroq
Copy link

@jinroq jinroq commented Jul 5, 2019

It is incorrect setting TENANT configuration in user_credentials_example. If configured correctly, we will get the following error message:

ERROR -- <Correlation ID>: Parsed an ErrorResponse with error: invalid_client and error description: AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.

So, AuthenticationContext#acquire_token_for_use has been modified to allow to set client_secret.

* Changed the specification of TENANT
* Added client_secret
@@ -40,7 +41,7 @@ def prompt(*args)

user_cred = ADAL::UserCredential.new(username, password)
ctx = ADAL::AuthenticationContext.new(AUTHORITY_HOST, TENANT)
result = ctx.acquire_token_for_user(RESOURCE, CLIENT_ID, user_cred)
result = ctx.acquire_token_for_user(RESOURCE, CLIENT_ID, user_cred, { ADAL::RequestParameters::CLIENT_SECRET => CLIENT_SECURET })
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SECURET should be spelt SECRET

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants