Skip to content

Instantly share code, notes, and snippets.

@wjgilmore
Created May 6, 2020 15:29
Show Gist options
  • Save wjgilmore/011f11455b62f35bfefbcfb0b7d8d143 to your computer and use it in GitHub Desktop.
Save wjgilmore/011f11455b62f35bfefbcfb0b7d8d143 to your computer and use it in GitHub Desktop.
Callback script for Active Directory OAuth
<?php
$qs = $_SERVER['QUERY_STRING'];
$domain = 'https://demo.dreamfactory.com/';
# Create a connection
$url = $domain . '/api/v2/user/session?oauth_callback=true&' . $qs;
$ch = curl_init($url);
# Setting our options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
# Get the response
$response = curl_exec($ch);
curl_close($ch);
var_dump(json_decode($response));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment