Skip to content

Instantly share code, notes, and snippets.

View Carlo-F's full-sized avatar
🏠
Working from home

Carlo Feniello Carlo-F

🏠
Working from home
View GitHub Profile
@Carlo-F
Carlo-F / github-oauth2-client.php
Last active May 14, 2020 09:33
Simple PHP example of using Github's OAuth 2 API
<?php
define('OAUTH2_CLIENT_ID', '');
define('OAUTH2_CLIENT_SECRET', '');
// see https://developer.github.com/v3/#user-agent-required
define('APP_NAME','GH WHATEVER');
$authorizeURL = 'https://github.com/login/oauth/authorize';
$tokenURL = 'https://github.com/login/oauth/access_token';
$apiURLBase = 'https://api.github.com';
// or, in the case of https://education.github.com/pack, uncomment this: