0

I have the following python code in my Matillion PythonScript component:

from office365.sharepoint.client_context import ClientContext
from office365.runtime.auth.authentication_context import AuthenticationContext
authority_url = “https://login.microsoftonline.us/<tenant_id>”

site_url = “https://mysite.sharepoint.us/sites/myfolder”
auth_ctx = AuthenticationContext(authority_url)

if auth_ctx.acquire_token_for_app(client_id, client_secret):
  ctx = ClientContext(site_url, auth_ctx)
  web = ctx.web
  ctx.load(web)
  ctx.execute_query()

  print("Web Title:", web.properties["Title"])
else:
  raise ValueError(“Failed to acquire token for the given client credentials.”)

It errors out at ctx.execute_query() with the following error message

ValueError: {“error”:“invalid_request”,“error_description”:"AADSTS900023: Specified tenant identifier ‘none’ is neither a valid DNS name, nor a valid external domain.

Is there a way to trouble shoot the cause of this error, since the error message is not very informative?

1
  • Ensure that Proper Tenant ID in URL and check client_id and client_secret. Commented Mar 31 at 9:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.