Skip to content

Type checking error: AsyncOAuth2Client has no attribute "get" #899

Description

@0x1618

Describe the bug

When using AsyncOAuth2Client, Pylance (or Pyright) raises a reportAttributeAccessIssue error, stating that the get attribute is unknown for the AsyncOAuth2Client class.

Error Stacks

Cannot access attribute "get" for class "AsyncOAuth2Client"
  Attribute "get" is unknown Pylance (reportAttributeAccessIssue)

To Reproduce

A minimal example to reproduce the behavior:

from authlib.integrations.httpx_client import AsyncOAuth2Client

async def fetch_profile():
    client = AsyncOAuth2Client(
        client_id="your_client_id",
        client_secret="your_client_secret",
        state="your_state"
    )
    
    # Type checker raises an error here
    response = await client.get(url="https://example.com/oauth/profile")

    return response

Expected behavior

The type checker (Pylance/Pyright) should recognize get, post, and other standard HTTP methods on AsyncOAuth2Client.

Environment:

  • OS: macos 26.5
  • Python Version: 3.13
  • Authlib Version: 1.7.2

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

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions