You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Василий Тащилин 8e0857fb44 revert 11 months ago
fastapi_sso_client fix empty state 11 months ago
tests add client tests 11 months ago
.gitignore initial commit 11 months ago
Pipfile revert 11 months ago
Pipfile.lock revert 11 months ago fix 11 months ago revert 11 months ago



$ pipenv install -e git+


from fastapi import FastAPI, Depends

from fastapi_sso_client.auth import setup_auth
from import DumbJWTStorage
from fastapi_sso_client.deps import SSOAuthHeader

app = FastAPI(
    title="PROJECT_NAME", openapi_url=f"/api/v1/openapi.json"
jwt_depends = Depends(SSOAuthHeader(name="JWT"))

@app.get("/test", dependencies=[jwt_depends])
def test():
    return {"status": "ok"}

def token(token: str = jwt_depends):
    return {"token": token}

setup_auth(app, "SSO_HOST", "SSO_ACCESS_TOKEN", "SSO_ACCESS_KEY", "SSO_ISSUER", DumbJWTStorage())