This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('OAUTH2_CLIENT_ID', 'YOUR APP CLIENT ID HERE'); | |
define('OAUTH2_CLIENT_SECRET', 'YOUR APP CLIENT SECRET HERE'); | |
$authorizeURL = 'https://github.com/login/oauth/authorize'; | |
$tokenURL = 'https://github.com/login/oauth/access_token'; | |
$apiURLBase = 'https://api.github.com/'; | |
session_start(); | |
// Start the login process by sending the user to Github's authorization page | |
if(isset($_GET['action']) && $_GET['action'] == 'login'){ | |
// Generate a random hash and store in the session for security |