google auth
Browse files
agentic_implementation/setup_oauth.py
CHANGED
@@ -11,6 +11,10 @@ import json
|
|
11 |
from pathlib import Path
|
12 |
from oauth_manager import oauth_manager
|
13 |
from logger import logger
|
|
|
|
|
|
|
|
|
14 |
|
15 |
def print_banner():
|
16 |
"""Print setup banner"""
|
@@ -78,31 +82,16 @@ def setup_oauth_credentials():
|
|
78 |
"""Guide user through OAuth credentials setup"""
|
79 |
print_step(3, "OAuth Client Credentials Setup")
|
80 |
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
print("\nπ Enter your OAuth credentials:")
|
93 |
-
|
94 |
-
while True:
|
95 |
-
client_id = input("Client ID: ").strip()
|
96 |
-
if client_id:
|
97 |
-
break
|
98 |
-
print("β Client ID cannot be empty")
|
99 |
-
|
100 |
-
while True:
|
101 |
-
client_secret = input("Client Secret: ").strip()
|
102 |
-
if client_secret:
|
103 |
-
break
|
104 |
-
print("β Client Secret cannot be empty")
|
105 |
-
|
106 |
try:
|
107 |
oauth_manager.setup_client_secrets(client_id, client_secret)
|
108 |
print("β
OAuth credentials saved successfully")
|
|
|
11 |
from pathlib import Path
|
12 |
from oauth_manager import oauth_manager
|
13 |
from logger import logger
|
14 |
+
from dotenv import load_dotenv
|
15 |
+
load_dotenv()
|
16 |
+
import os
|
17 |
+
|
18 |
|
19 |
def print_banner():
|
20 |
"""Print setup banner"""
|
|
|
82 |
"""Guide user through OAuth credentials setup"""
|
83 |
print_step(3, "OAuth Client Credentials Setup")
|
84 |
|
85 |
+
client_id = os.getenv("GOOGLE_CLIENT_ID")
|
86 |
+
client_secret = os.getenv("GOOGLE_CLIENT_SECRET")
|
87 |
+
|
88 |
+
if not client_id or not client_secret:
|
89 |
+
print("β Missing GOOGLE_CLIENT_ID or GOOGLE_CLIENT_SECRET in your .env")
|
90 |
+
print(" Please add:")
|
91 |
+
print(" GOOGLE_CLIENT_ID=your-client-id")
|
92 |
+
print(" GOOGLE_CLIENT_SECRET=your-client-secret")
|
93 |
+
return False
|
94 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
try:
|
96 |
oauth_manager.setup_client_secrets(client_id, client_secret)
|
97 |
print("β
OAuth credentials saved successfully")
|