Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Instagram OAuth proxy
<?php
// Registered Instagram redirect URI: http://example.com/instagramproxy.php
// Custom YOUR_APP_CALLBACK redirect URI: http://example.com/instagramproxy.php?redirect=http://foo.com
// receive OAuth code parameter
$code = $_GET['code'];
$redirectHost = $_GET['redirect'];
$instagramEndpoint = $redirectHost . "/success.php?code=" . $code;
// authentication failed -> redirect to login
header('Location: ' . $instagramEndpoint);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.