Skip to main content

Google OpenID integration for FastAPI

Project description

fastapi-openid-google

Google OpenID integration for FastAPI.

Usage

import fastapi

from fastapi_openid_google import setup_openid

app = fastapi.FastAPI()
setup_openid(app)


@app.get("/")
def home(
    request: fastapi.Request,
):
    if request.state.user:
        return {
            "current_user": request.state.user,
            "logout": f"/logout",
        }
    else:
        return {"login": f"/login"}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_openid_google-0.0.1.dev1.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page