30 lines
1.0 KiB
Python
30 lines
1.0 KiB
Python
import urllib.request
|
|
import ssl
|
|
import json
|
|
|
|
ctx = ssl.create_default_context()
|
|
ctx.check_hostname = False
|
|
ctx.verify_mode = ssl.CERT_NONE
|
|
|
|
req = urllib.request.Request(
|
|
"https://authentik.snarfnet.net/api/v3/flows/instances/?designation=authorization",
|
|
headers={"Authorization": "Bearer SnarfNetPermanentAutomationToken2026"}
|
|
)
|
|
|
|
with urllib.request.urlopen(req, context=ctx, timeout=5) as resp:
|
|
data = json.loads(resp.read().decode('utf-8'))
|
|
print("Authorization flows:")
|
|
for f in data.get('results', []):
|
|
print(f" {f.get('name')} (slug: {f.get('slug')}, pk: {f.get('pk')})")
|
|
|
|
req3 = urllib.request.Request(
|
|
"https://authentik.snarfnet.net/api/v3/propertymappings/provider/scope/",
|
|
headers={"Authorization": "Bearer SnarfNetPermanentAutomationToken2026"}
|
|
)
|
|
with urllib.request.urlopen(req3, context=ctx, timeout=5) as resp:
|
|
data3 = json.loads(resp.read().decode('utf-8'))
|
|
print("Scope Property Mappings:")
|
|
for m in data3.get('results', []):
|
|
print(f" {m.get('scope_name')}: {m.get('pk')}")
|
|
|