Skip to content

Instantly share code, notes, and snippets.

@AdnanHussainTurki
Created February 14, 2021 22:51
Show Gist options
  • Save AdnanHussainTurki/66e2f90cdd815ad83f99b2e8029ea459 to your computer and use it in GitHub Desktop.
Save AdnanHussainTurki/66e2f90cdd815ad83f99b2e8029ea459 to your computer and use it in GitHub Desktop.

Revisions

  1. AdnanHussainTurki created this gist Feb 14, 2021.
    18 changes: 18 additions & 0 deletions signin.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    <?php

    session_start();

    require "vendor/autoload.php";

    use myPHPnotes\Microsoft\Auth;


    $tenant = "common";
    $client_id = "f6e12fd3-c628-4694-9c44-290e89e71543";
    $client_secret = "s_cB1Aj-0I.0XWa3eVJ6SSf~1EQS3E5r~3";
    $callback = "http://localhost:8080/callback.php";
    $scopes = ["User.Read"];

    $microsoft = new Auth($tenant, $client_id, $client_secret,$callback, $scopes);

    header("location: " . $microsoft->getAuthUrl());