-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_token.py
More file actions
22 lines (16 loc) · 578 Bytes
/
test_token.py
File metadata and controls
22 lines (16 loc) · 578 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python3
import requests
# Your token
token = "your_token_here"
headers = {"Authorization": f"Bearer {token}"}
print("🧪 Testing your Microsoft token...")
try:
response = requests.get("http://localhost:5001/api/helloworld", headers=headers)
print(f"Status Code: {response.status_code}")
print(f"Response: {response.json()}")
if response.status_code == 200:
print("✅ SUCCESS! Your token is working!")
else:
print("❌ Still getting an error. Let's check details...")
except Exception as e:
print(f"❌ Error: {e}")