定制 webnode/oauth2-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-17