PHP code example of rahife / socialite-adfs-provider

1. Go to this page and download the library: Download rahife/socialite-adfs-provider 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/ */

    

rahife / socialite-adfs-provider example snippets


'Adfs' => [
  'client_id' => env('ADFS_CLIENT_ID'), // Sample: 78d90125-a243-416a-b8b5-c2c7574e9e85 
  'client_secret' => env('ADFS_CLIENT_SECRET'), // Sample: IGlnE3M5XFoWCPb/lXBUtSA2X5z3M6lbMSax13UH8HU=
  'redirect' => env('ADFS_REDIRECT'), // Sample: https://your-application.example.com/sso/callback
  'adfs_server' => env('ADFS_SERVER'),   // Sample: https://my-idp.example.com
],

Route::get('/sso/redirect', function () {
    return Socialite::driver('Adfs')->redirect();
});

Route::get('/sso/callback', function () {
    $user = Socialite::driver('Adfs')->user();

    // Available User fields 
    // $user->nickname 
    // $user->name 
    // $user->email

    // Your custom logic ...

});