Hi all,
I've written about this before but no responses. But now, I am writing again with more context and more information provided. My post stems from StackOverflow, where my colleague has posted as well: https://stackoverflow.com/questions/77657489/using-python-to-connect-to-sharepoint-via-app-sign-in-c...
Connecting to SharePoint to Write/Read Files through App Sign in Method (Client ID, Secret & Tenant ID) but wouldn't be able to get authenticated.
I have tried the code below:
from office365.sharepoint.client_context import ClientContext
from office365.runtime.auth.client_credential import ClientCredential
from office365.runtime.auth.authentication_context import AuthenticationContext
context = ClientContext(SITE_URL).with_credentials(
ClientCredential(CLIENT_ID, CLIENT_SECRET))
cert_credentials = {
"tenant": TENANT_ID,
"client_id": CLIENT_ID,
"thumbprint": test_cert_thumbprint,
"cert_path": "{0}/../selfsignkey.pem".format(os.path.dirname(__file__)),
}
ctx = ClientContext(test_site_url).with_client_certificate(**cert_credentials)
current_web = ctx.web.get().execute_query()
print("{0}".format(current_web.url))
from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.sharepoint.client_context import ClientContext
class SharepointService:
app_principal = {'client_id': CLIENT_ID, 'client_secret': CLIENT_SECRET}
context_auth = AuthenticationContext(url=site_url)
token = context_auth.acquire_token_for_app(client_id=app_principal['client_id'], client_secret=app_principal['client_secret'])
print(token)
ctx = ClientContext(site_url, context_auth)
web = ctx.web
ctx.load(web)
ctx.execute_query()
print("Web site title: {0}".format(web.properties['Title']))
We ran into this error
I would appreciate any and all advice/help on this!!
I know close to 0 about Azure workings but here's what I see on that specific error - https://community.auth0.com/t/azure-entra-connection-error-aadsts900023-specified-tenant-identifier-...
The two places I'd look would be what's being passed in SITE_URL and test_site_url?
That makes the two of us! I am trying to navigate this with limited IT Access support... just a nightmare. I'll read into what you sent and report back should I find something! Thanks @apathetichell
Hi @apathetichell - I've tried reading your link and going about it, but no luck still.
Hoping someone else can jump in - or even if Alteryx staff / engineers can chime in, that would be great.
User | Count |
---|---|
52 | |
27 | |
26 | |
24 | |
21 |