You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got tempted to pass api_key = 'my-super-duper-secret-key' to the Configuration object, as one has an API key at hand, and all I got was a 403 Error (t-shirt material right there).
importosimportsysimportauthentik_clientdefmain():
host=os.environ.get("AUTHENTIK_HOST") # I passed here a URL ending in "/api/v3" even though is called "host", see #9 token=os.environ.get("AUTHENTIK_TOKEN")
ifnottoken:
print("AUTHENTIK_TOKEN unset")
sys.exit(1)
ifnothost:
print("AUTHENTIK_URL unset")
sys.exit(1)
configuration=authentik_client.Configuration(
host=host,
api_key=token
)
withauthentik_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=authentik_client.AdminApi(api_client)
try:
api_response=api_instance.admin_apps_list()
print("The response of AdminApi->admin_apps_list:\n")
print(api_response)
exceptauthentik_client.ApiExceptionase:
print("Exception when calling AdminApi->admin_apps_list: %s\n"%e)
if__name__=="__main__":
main()
Activity