PHP code example of james-machouk / azure-ad-auth

1. Go to this page and download the library: Download james-machouk/azure-ad-auth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

james-machouk / azure-ad-auth example snippets


//set you User model correct path
  "user_model" => App\User::class,
//this is where to redirect users if theirs login succeed ( user route name only )
  "redirect_success" => "home",
//this is where to redirect users if theirs login fails
  "redirect_fail" => "/",

Auth::routes();

if(!env('OVERRIDE_DEFAULT_LOGIN')){
    Auth::routes();
}

return redirect()->route('adLogout');
//if you are using your own logout method just add this line at the end or after your function.

public function loggedOut(Request $request)
{
    return redirect()->route('adLogout');
}
// this function is called by the default laraval's logout method
bash
php artisan vendor:publish --provider="JamesMachouk\azureAdAuth\AzureAdAuthServiceProvider"