gwsn / bizhost-auth-sdk
用户身份验证针对Bizhost Auth API
1.0.5
2024-05-10 14:29 UTC
Requires
- php: ^8.1
- firebase/php-jwt: ^6.10
- guzzlehttp/guzzle: ^7.4
Requires (Dev)
- phpunit/phpunit: ^9.5
README
有关Symfony包的信息,请查看以下包: gwsn/bizhost-auth-sdk
安装
您可以通过composer安装此包
composer require gwsn/bizhost-auth-sdk
在symfony中使用时,请转到包而不是Bundle
首次配置以开始使用
您需要为应用程序请求新的clientId和clientSecret
-
前往
bizhost认证门户
https://auth.bizhost.nl/ -
前往
注册新应用程序
并按照向导操作。
(给它起一个名字,比如我的名字是 'example-app-authentication') -
创建应用程序后,请写下以下详细信息
-
'应用程序标识符',这将成为您的
$clientId
-
'应用程序密钥',这将成为您的
$clientSecret
(请确保写下这个,因为它只会显示一次)示例
- 认证元URL:
https://auth.bizhost.nl/.well-known/oauth-authorization-server
- 认证元URL:
Bizhost认证SDK的基本设置
$apiUrl = 'https://auth-test.bizhost.nl'; $clientId = 'your-client-id'; $clientSecret = 'your-client-secret'; $redirectUrl = 'https://:8000/code-flow.php'; $issuerMetaDataPath = '/.well-known/oauth-authorization-server'; $config = new AuthClientConfig( apiUrl: $apiUrl, clientId: $clientId, clientSecret: $clientSecret, redirectUrl: $redirectUrl, issuerMetaDataPath: $issuerMetaDataPath ); $authService = new AuthenticateService( $config, );
有关更多信息,请参阅示例目录
测试
$ composer run-script test
安全
如果您发现任何与安全相关的问题,请通过电子邮件 support@bizhost.nl 而不是使用问题跟踪器。
许可证
MIT许可证(MIT)。请参阅 许可证文件 获取更多信息。