Fix Twitch OAuth redirect URI and update setup instructions
This commit is contained in:
@@ -31,7 +31,7 @@ This document provides instructions to set up and test the MultiChat Overlay app
|
||||
## 3. Configure Twitch API Credentials
|
||||
|
||||
1. **Create Twitch Application:** Go to the Twitch Developer Console (dev.twitch.tv/console/apps) and create a new application.
|
||||
* Set the **OAuth Redirect URLs** to `http://localhost/auth/twitch/callback.php` (or `http://localhost:PORT/auth/twitch/callback.php` if you're using a different port for your PHP server).
|
||||
* Set the **OAuth Redirect URLs** to `http://localhost/auth.php` (or `http://localhost:PORT/auth.php` if you're using a different port for your PHP server).
|
||||
2. **Get Client ID and Secret:** Note down your Client ID and generate a Client Secret.
|
||||
3. **Update `php/config.php`:** Open `/home/joe/MultiChatOverlay/php/config.php` and update the `TWITCH_CLIENT_ID`, `TWITCH_CLIENT_SECRET`, and `TWITCH_REDIRECT_URI` constants with your application's credentials.
|
||||
|
||||
|
||||
19
php/auth/twitch/login.php
Normal file
19
php/auth/twitch/login.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
// php/auth/twitch/login.php - Initiates Twitch OAuth flow
|
||||
|
||||
require_once '../../config.php';
|
||||
|
||||
// Scopes required to get user's email and channel info
|
||||
$scopes = "user:read:email chat:read"; // Ensure chat:read is included
|
||||
|
||||
$auth_url = (
|
||||
"https://id.twitch.tv/oauth2/authorize" .
|
||||
"?client_id=" . TWITCH_CLIENT_ID .
|
||||
"&redirect_uri=" . TWITCH_REDIRECT_URI .
|
||||
"&response_type=code" .
|
||||
"&scope=" . urlencode($scopes)
|
||||
);
|
||||
|
||||
header("Location: " . $auth_url);
|
||||
exit();
|
||||
?>
|
||||
24
php/config.php
Normal file
24
php/config.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
// php/config.php
|
||||
|
||||
// Database credentials
|
||||
define('DB_HOST', 'localhost');
|
||||
define('DB_USER', 'multichat_user'); // Replace with your MySQL username
|
||||
define('DB_PASS', '!Bdsbkh2!'); // Replace with your MySQL password
|
||||
define('DB_NAME', 'multichat_overlay');
|
||||
|
||||
// Twitch API credentials
|
||||
define('TWITCH_CLIENT_ID', 'hf00cu69zzjxbmtmjipzebrmsexuxt'); // Replace with your Twitch Client ID
|
||||
define('TWITCH_CLIENT_SECRET', '9iqweehbkx113hqmrhigk3rsaoiyqa'); // Replace with your Twitch Client Secret
|
||||
define('TWITCH_REDIRECT_URI', 'http://localhost/auth.php'); // Replace with your redirect URI
|
||||
|
||||
// Session secret for secure cookies
|
||||
define('SESSION_SECRET', 'o2LuCTQHN1JMlR0HeciJTNTx9OMFg5zXBiEpes26ouo='); // IMPORTANT: Change this to a strong, random string
|
||||
|
||||
// WebSocket server address
|
||||
define('WEBSOCKET_HOST', 'localhost');
|
||||
define('WEBSOCKET_PORT', 8080);
|
||||
|
||||
// Base URL for the application
|
||||
define('BASE_URL', 'http://localhost'); // Replace with your application's base URL
|
||||
?>
|
||||
Reference in New Issue
Block a user