webnode/oauth2-client
最新稳定版本:1.5.0
Composer 安装命令:
composer require webnode/oauth2-client
包简介
README 文档
README
Client for webnode auth/OAuth2
This can be used as SDK by partners, co no webnode library should be used.
Usage example
Instantiate factory
$factory = new \webnode\oauth2\Factory\WebnodeOAuth2Factory(
new \webnode\oauth2\Configuration(
'myClientId',
'myClientSecret',
'https://oauth2.webnode.com'
)
);
Generate Single Sign On Url
// generate SSO Link
$oauthApiService = $factory->createApi();
$ssoUrl = $oauthApiService->getAuthorizationUrlForUser(
$userIdentifier,// obtained from gateway-api with project info or registration
$redirectUrl // CMS or Administration (portal) URL, both can be obtained with same request as userIdentifier
);
// now just redirect to $ssoUrl
Generate Single Sign Out Url
// generate SSO Link
$urlGenerator = $factory->createUrlGenerator();
$ssOutUrl = $urlGenerator->getSSOutUrl(); // this url is universal, since it just disables access to current session
// now just redirect to $ssOutUrl
Logout user from all sessions
This can be used when changing password, disabling users access for violation and so on.
// generate SSO Link
$oauthApiService = $factory->createApi();
$urlGenerator->revokeUserAccess($userIdentifier);
// now just redirect to $ssOutUrl
统计信息
- 总下载量: 15.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-17