tessl install tessl/pypi-google-auth-oauthlib@1.2.0Google 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%
Build a command-line tool that performs OAuth 2.0 authentication for Google APIs with a configurable redirect URI.
Your tool should accept command-line arguments to configure the OAuth flow and must support custom redirect URI specification. The tool should:
The tool should be invoked as follows:
python oauth_tool.py --client-secrets <path> --scopes <scope1> <scope2> --redirect-uri <uri>Example:
python oauth_tool.py \
--client-secrets client_secrets.json \
--scopes https://www.googleapis.com/auth/drive.readonly \
--redirect-uri http://localhost:9000/oauth2callbackThe tool should output:
@generates
import argparse
def create_oauth_flow(client_secrets_path: str, scopes: list, redirect_uri: str):
"""
Create an OAuth flow with the specified configuration.
Args:
client_secrets_path: Path to client secrets JSON file
scopes: List of OAuth 2.0 scopes to request
redirect_uri: Custom redirect URI for the OAuth flow
Returns:
Configured OAuth flow instance
"""
pass
def main():
"""
Main entry point for the OAuth tool.
Parses command-line arguments and runs the OAuth flow.
"""
pass
if __name__ == "__main__":
main()Provides OAuth 2.0 flow implementation for Google APIs with support for custom redirect URI configuration.