PHP SSO SDK
dev-master
2024-07-05 07:56 UTC
Requires
- php: >=8.1
- ext-curl: *
- ext-json: *
This package is auto-updated.
Last update: 2024-09-05 08:31:59 UTC
README
简介
此SDK是一组库的集合,允许您与SSO API交互。SDK仅适用于PHP8.2及以上版本。
安装
要安装SDK,您可以使用composer。运行以下命令
composer require dnxcorp/sso-sdk
用法
// $myUser is your user object $token = 'your_token'; $client = new Client($token); $response = $client->register('email@test.com', '127.0.0.1', 'FR', 'en', 'c0023'); if ($response->isSuccess()) { $myUser->setLoginToken($response->getLoginToken()); // Persist changes in database, it won't be displayed anymore } // Redirect to the website header('Location: ' . $response->getRedirectUrl());