Skip to main content
Glama
start_oauth_server.pyβ€’3.22 kB
#!/usr/bin/env python3 """ IRIS OAuth Server Launcher Avvia il server FastAPI per OAuth Microsoft authentication """ import os import sys from pathlib import Path # Add src to path project_root = Path(__file__).parent.parent sys.path.insert(0, str(project_root)) # Load environment variables from dotenv import load_dotenv load_dotenv(project_root / ".env") def check_config(): """Check if OAuth is configured""" client_id = os.getenv("MICROSOFT_CLIENT_ID", "") client_secret = os.getenv("MICROSOFT_CLIENT_SECRET", "") redirect_uri = os.getenv("OAUTH_REDIRECT_URI", "") print("=" * 70) print("πŸ” IRIS OAuth Server") print("=" * 70) print() if not client_id or client_id == "your_client_id_here": print("⚠️ MICROSOFT_CLIENT_ID not configured!") print(" β†’ Register app at: https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade") print(" β†’ Add client ID to .env file") print() else: print(f"βœ… Client ID: {client_id[:10]}...") if not client_secret or client_secret == "your_client_secret_here": print("⚠️ MICROSOFT_CLIENT_SECRET not configured!") print(" β†’ Generate secret in Azure portal") print(" β†’ Add to .env file") print() else: print("βœ… Client Secret: configured") print(f"βœ… Redirect URI: {redirect_uri}") print() if not client_id or not client_secret or \ client_id == "your_client_id_here" or client_secret == "your_client_secret_here": print("❌ OAuth NOT configured. Please configure credentials first.") print() print("πŸ“‹ Setup Instructions:") print("1. Go to Azure Portal: https://portal.azure.com") print("2. Navigate to: Azure Active Directory β†’ App registrations") print("3. Click 'New registration'") print("4. Set Redirect URI: https://trustypa.brainaihub.tech/oauth/callback") print("5. Copy Application (client) ID β†’ Add to .env as MICROSOFT_CLIENT_ID") print("6. Create new client secret β†’ Add to .env as MICROSOFT_CLIENT_SECRET") print() return False return True def main(): """Start OAuth server""" import uvicorn configured = check_config() if not configured: response = input("Start anyway? (y/N): ") if response.lower() != 'y': print("Exiting...") sys.exit(1) print("=" * 70) print("πŸš€ Starting OAuth Server") print("=" * 70) print() print("Server will be available at:") print(" β€’ Local: http://localhost:8000") print(" β€’ Public: https://trustypa.brainaihub.tech") print() print("Endpoints:") print(" β€’ Home: /") print(" β€’ Login: /oauth/login") print(" β€’ Callback: /oauth/callback") print(" β€’ Health: /health") print() print("Press CTRL+C to stop") print("=" * 70) print() # Start server uvicorn.run( "src.oauth_server.app:app", host="0.0.0.0", port=8000, reload=True, log_level="info", ) if __name__ == "__main__": main()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ilvolodel/iris-legacy'

If you have feedback or need assistance with the MCP directory API, please join our Discord server