Quickstart
Choose Your Quickstart
Quick Comparison
Provider
Setup Time
Best For
What You'll Learn
Provider-Agnostic Code
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
# Same code works with any provider
from fastapi import Depends
from gl_iam import User
from gl_iam.fastapi import get_current_user, require_org_admin
@app.get("/me")
async def get_me(user: User = Depends(get_current_user)):
return {"email": user.email, "roles": user.roles}
@app.get("/admin")
async def admin_only(
user: User = Depends(get_current_user),
_: None = Depends(require_org_admin()),
):
return {"message": f"Welcome, Admin {user.display_name}!"}