* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * @author James McQuillan <*****@*****.**> * @license MIT * @copyright (C) 2016 onwards Microsoft Corporation (http://microsoft.com/) */ require __DIR__ . '/../../vendor/autoload.php'; // Construct. $httpclient = new \remotelearner\aadsample\HttpClient(); $storage = new \remotelearner\aadsample\OIDC\StorageProviders\SQLite(__DIR__ . '/storagedb.sqlite'); $client = new \remotelearner\aadsample\AAD\Client($httpclient, $storage); // Set credentials. require __DIR__ . '/config.php'; if (!defined('AADSAMPLE_CLIENTID') || empty(AADSAMPLE_CLIENTID)) { throw new \Exception('No client ID set - please set in config.php'); } $client->set_clientid(AADSAMPLE_CLIENTID); if (!defined('AADSAMPLE_CLIENTSECRET') || empty(AADSAMPLE_CLIENTSECRET)) { throw new \Exception('No client secret set - please set in config.php'); } $client->set_clientsecret(AADSAMPLE_CLIENTSECRET); if (!defined('AADSAMPLE_CLIENTREDIRECTURI') || empty(AADSAMPLE_CLIENTREDIRECTURI)) { throw new \Exception('No redirect URI set - please set in config.php'); } $client->set_redirecturi(AADSAMPLE_CLIENTREDIRECTURI); // Process response.
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * @author James McQuillan <*****@*****.**> * @license MIT * @copyright (C) 2016 onwards Microsoft Corporation (http://microsoft.com/) */ require __DIR__ . '/../../vendor/autoload.php'; // Construct. $httpclient = new \remotelearner\aadsample\HttpClient(); $storage = new \remotelearner\aadsample\OIDC\StorageProviders\SQLite(__DIR__ . '/storagedb.sqlite'); $client = new \remotelearner\aadsample\AAD\Client($httpclient, $storage); // Set credentials. require __DIR__ . '/config.php'; if (!defined('AADSAMPLE_CLIENTID') || empty(AADSAMPLE_CLIENTID)) { throw new \Exception('No client ID set - please set in config.php'); } $client->set_clientid(AADSAMPLE_CLIENTID); if (!defined('AADSAMPLE_CLIENTSECRET') || empty(AADSAMPLE_CLIENTSECRET)) { throw new \Exception('No client secret set - please set in config.php'); } $client->set_clientsecret(AADSAMPLE_CLIENTSECRET); if (!defined('AADSAMPLE_CLIENTREDIRECTURI') || empty(AADSAMPLE_CLIENTREDIRECTURI)) { throw new \Exception('No redirect URI set - please set in config.php'); } $client->set_redirecturi(AADSAMPLE_CLIENTREDIRECTURI); // Make request.