PHP code example of zifan / socialite-dingtalk

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

    

zifan / socialite-dingtalk example snippets


'dingtalk' => [
	'client_id' => env('DINGTALK_CLIENT_ID'),
	'client_secret' => env('DINGTALK_CLIENT_SECRET'),
	'redirect' => env('DINGTALK_REDIRECT_URI'),
	// 'guzzle' => ['verify' => false],
	// 'scopes' => ['openid'] #openid:授权后可获得用户userid(一般适用于企业内部应用);openid corpid:授权后可获得用户id和登录过程中用户选择的组织id
],

protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        'Zifan\\SocialiteDingtalk\\DingTalkExtendSocialite@handle',
    ],
];

return Socialite::driver('dingtalk')->redirect();