
Hi @Felipe Matheus,
You could grant access to app only and use client id and client secret to connect sharepoint
from office365.sharepoint.client_context import ClientContext
from tests import test_client_id, test_client_secret, test_site_url
ctx = ClientContext(test_site_url).with_client_credentials(
test_client_id, test_client_secret
)
target_web = ctx.web.get().execute_query()
print(target_web.url)
Here is the document for more details
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.