Several enhancements

This commit is contained in:
2025-06-01 20:03:39 +02:00
parent dee65e7aeb
commit 9004c27575
7 changed files with 224 additions and 25 deletions
+21
View File
@@ -0,0 +1,21 @@
from msal import PublicClientApplication
CLIENT_ID = "2a1cb9f1-2c0c-46ad-9887-fd2bb835bc2e"
AUTHORITY = "https://login.microsoftonline.com/consumers" # or your tenant ID
SCOPES = ["https://graph.microsoft.com/Calendars.Read"]
USERNAME = "zisco@zisco.at"
PASSWORD = "3S1punk08_114$" # ⚠️ Storing passwords is risky
app = PublicClientApplication(CLIENT_ID, authority=AUTHORITY)
result = app.acquire_token_by_username_password(
username=USERNAME,
password=PASSWORD,
scopes=SCOPES
)
if "access_token" in result:
print("Access token:", result["access_token"])
else:
print("Error:", result.get("error_description"))