Metadata-Version: 2.4
Name: google-auth-easy
Version: 0.0.2
Summary: Google Authentication with Python, but easy
License-File: LICENSE
Author: danialcala94
Author-email: danielalcalavalera@gmail.com
Requires-Python: >=3.10,<3.14
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: google-api-python-client (>=2.198.0,<9999.0.0)
Requires-Dist: google-auth (>=2.56.2,<9999.0.0)
Requires-Dist: google-auth-oauthlib (>=1.4.0,<9999.0.0)
Description-Content-Type: text/markdown

# Google Auth with Python, but easy

The easiest way to authenticate for the Google services.

This library is intented to simplify the interaction with the Google API for using the Google services such as Youtube, Slides, etc.

# Instructions
1. Go to the Google Developers console: https://console.cloud.google.com.
2. Go to the APIs library (https://console.cloud.google.com/apis/library) and enable the one you need.
3. Go to the Oauth Credentials section (https://console.cloud.google.com/apis/credentials) and create a new Oauth Authentication ID for a `Desktop App`. Remember to download it as a JSON file when created. *Maybe you need to create a Consent screen (enable as testing and add yourself as a tester or publish it) and create a new project in the console.
4. Place the `client-secret.json` in the project.
5. Indicate that `client-secret.json` and use the library. You will generate a `token.json` that will be used to consider you as an authenticated user.


# Usage
```
# Indicate your client_secret file
config = GoogleAuthConfig(
    client_secret_file = 'client_secret.json',
)

# Initialize the instance
auth = GoogleAuth(config)

# Authenticate it for your desired scopes
auth.authenticate(
    Scope.DRIVE_READONLY,
)
```

# Extra information
## client_secret.json
Your client secret information  must be a `.json` file that 
includes your client id, your client secret and some other 
fields. You can download this information from Google API
web platform by creating your Oauth user. Here is an example:
```
{
    "web": {
    "client_id": "XXXXXXX.apps.googleusercontent.com",
    "client_secret": "XXXXXX",
    "redirect_uris": [],
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://accounts.google.com/o/oauth2/token"
    }
}
```

## token.json
Your token must be a `.json` file that includes the information needed to authenticate your user, and some extra information such as if the token can be refreshed or not:
```
{"token": "ya29.a0ARGnu0ZyKzwSGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXwhXw0206", "refresh_token": "1//0g7tTXXXXXXXXXXXXXXXXXXXXXSNwF-L9Ir_hEj8XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX7le_X6XXXXXXXXXXXQ", "token_uri": "https://oauth2.googleapis.com/token", "client_id": "59591XXXXXXXXXXXXXXXXXXXXXXXg1ti.apps.googleusercontent.com", "client_secret": "GXXXXXX-3gDXXXXXXXXXXXXXXXXXXXXXJP", "scopes": ["https://www.googleapis.com/auth/drive.readonly"], "universe_domain": "googleapis.com", "account": "", "expiry": "2026-08-05T12:37:57Z"}
```

