Skip to content

Support asyncio for authenticate_request #137

@utkuzih

Description

@utkuzih

The authenticate_request may make a sync request to fetch the JWK keys. This request is sync in the fetch_jwks function. This would cause asyncio mainloop to hang in fastapi (or other async) frameworks.

Technically we can pass in VerifyTokenOptions.jwk_key to the authenticate_request function. However, jwk_key is not easy to calculate as we have to download all JWK keys and then use kid (key id) provided as part of the bearer token. We would need to extract kid by decoding the bearer token.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions