-
Notifications
You must be signed in to change notification settings - Fork 208
Closed
Labels
Description
Describe the bug
A clear and concise description of what the bug is.
UPDATE by Ray: There is also an internal issue created here, which is currently under investigation by our service side team.
To Reproduce
Steps to reproduce the behavior:
- Go to our off-the-shelf samples and pick one that is closest to your usage scenario. You should not need to modify the sample.
- Follow the description of the sample, typically at the beginning of it, to prepare a
config.jsoncontaining your test configurations - Run such sample, typically by
python sample.py config.json - See the error
- In this bug report, tell us the sample you choose, paste the content of the config.json with your test setup (which you can choose to skip your credentials, and/or mail it to our developer's email).
import msal
import os
import sys
from pprint import pprint
SCOPES = ["https://graph.microsoft.us/.default"]
app = msal.ConfidentialClientApplication(
client_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
client_credential=['CLIENT_SECRET'],
authority='https://login.microsoftonline.us/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
)
result = app.acquire_token_silent(scopes=SCOPES, account=None)
if not result:
result = app.acquire_token_for_client(scopes=SCOPES)
if 'access_token' not in result:
msg = "Could not acquire Azure access token: {error}: {descr}".format(
error=result.get('error'),
descr=result.get('error_description'),
)
pprint(msg)
sys.exit(1)
pprint("Finished")
pprint(result)
Expected behavior
#result should equal None, evaluate if statement then acquire token for client
#works as expected in Azure Public cloud
result = app.acquire_token_silent(scopes=SCOPES, account=None)
if not result:
result = app.acquire_token_for_client(scopes=SCOPES)
What you see instead
Traceback starts with:
httplib_response = self._make_request(
Traceback ends with:
(Caused by SSLError(SSLCertVerificationError("hostname 'login.usgovcloudapi.net' doesn't match either of 'graph.aadg.microsoftonline.us', '*.b2clogin.us'")))
The MSAL Python version you are using
Paste the output of this
python -c "import msal; print(msal.__version__)"
MSAL version '1.4.1'
Additional context
Add any other context about the problem here.
#This returns token without issue
#result = app.acquire_token_silent(scopes=SCOPES, account=None)
#if not result:
result = app.acquire_token_for_client(scopes=SCOPES)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done