zeroweb / azuresso
Azure SSO集成包
2.2
2023-09-01 13:33 UTC
Requires
- php: >=8.1
- symfony/http-client: ^6.3
- symfony/http-foundation: ^6.3
README
快速集成Azure单一登录
安装
使用以下命令安装最新版本
$ composer require zeroweb/azuresso
基本用法
<?php use Symfony\Component\HttpFoundation\Request; use ZeroWeb\AzureSSO; $request = Request::createFromGlobals(); ## $azureCreds = array of the credenetials $config = [ 'clientId' => 'client id', 'clientSecret' => 'client secret', 'tenantId' => 'tenant id', 'scope' => 'User.Read GroupMember.Read.All', 'returnUrl' => 'https:///sso', 'returnGroups' => true, // set false to not return the user groups. If set to true, requires GroupMemeber.Read.All scope ]; $sso = new AzureSSO($config, $request); try { $sso->authenticate(); // The user is authenticated at this point and the session contains the auth data. } catch (Exception $e) { echo ("There was a problem with authentication." . $e->getMessage()); }