Skip to content

Add async Flask OAuth client #818

Description

@markhobson

Is your feature request related to a problem? Please describe.

The Flask OAuth client uses Requests and is thus synchronous. Although Flask is a predominately a synchronous web framework, it does support asynchronous views. This raises the possibility of an async Flask view wanting to use an async OAuth client.

This may also apply to the Django OAuth client.

Describe the solution you'd like

An async variant of FlaskOAuth2App that uses HTTPX.

Describe alternatives you've considered

Current workaround is to create a custom OAuth app:

class AsyncFlaskOAuth2App(AsyncOAuth2Mixin, AsyncOpenIDMixin, BaseApp):
    client_cls = AsyncOAuth2Client

oauth = OAuth(app)
oauth.register(
    client_cls=AsyncFlaskOAuth2App,
    ...
)

Additional context

N/A

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions