Ctrl + K
DocumentationLog inGet started

tessl/pypi-google-auth-oauthlib

tessl install tessl/pypi-google-auth-oauthlib@1.2.0

Google Authentication Library - oauthlib integration for OAuth 2.0 flows.

Agent Success

Agent success rate when using this tile

83%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.05x

Baseline

Agent success rate without this tile

79%

task.mdevals/scenario-2/

OAuth Session to Credentials Converter

A utility that converts OAuth 2.0 session objects into Google-compatible credential objects for use with Google APIs.

Capabilities

Convert OAuth Session to Credentials

  • Given an OAuth session with access token "test_access_token_123", refresh token "test_refresh_token_456", client ID "client_id_789", client secret "client_secret_xyz", and token URI "https://oauth2.googleapis.com/token", the converter returns a credentials object that can be used with Google APIs @test
  • Given an OAuth session with an ID token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9", the converter includes the ID token in the returned credentials @test
  • Given an OAuth session with token expiry set to a timestamp, the converter preserves the expiry information in the returned credentials @test

Handle Scopes

  • Given an OAuth session with requested scopes ["scope1", "scope2"] and granted scopes ["scope1"], the converter correctly sets both scope types in the credentials @test

Implementation

@generates

API

def convert_session_to_credentials(session, client_id, client_secret, token_uri):
    """
    Converts an OAuth 2.0 session into Google-compatible credentials.

    Args:
        session: An OAuth2Session object containing token information
        client_id: The OAuth client ID string
        client_secret: The OAuth client secret string
        token_uri: The token endpoint URI string

    Returns:
        A Google credentials object compatible with google-auth library
    """
    pass

Dependencies { .dependencies }

google-auth-oauthlib { .dependency }

Provides OAuth 2.0 integration with Google authentication library for converting sessions to credentials.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/google-auth-oauthlib@1.2.x
tile.json