killov/apple-sign-in
最新稳定版本:1.0.3
Composer 安装命令:
composer require killov/apple-sign-in
包简介
Apple ID - web sign in
README 文档
README
Library for web sign in over Apple ID.
Installation
For install please use composer.
composer require killov/apple-sign-in
Basic usage
Common code
$signIn = AppleSignInBuilder::create() ->setClientId("client") ->setTeamId("BDT54D54G5") ->setKeyPath("DG755G24FK", __DIR__ . "\keys\key.p8") ->setRedirectUrl($publicPath . "sign/apple-return") ->build();
Generate link for link button
$state = "random_code"; $_SESSION["state"] = $state; // store to session for for distraction CSRF $link = $signIn->createAuthUrl($state); // https://appleid.apple.com/auth/authorize?response_type=code...
Prepare a return endpoint (redirectUrl)
$state = $_POST["state"]; // validate state from session if ($_SESSION["state"] !== $state) { return; } $code = $_POST["code"]; // fetch JWT token $jwt = $signIn->fetchAccessTokenWithAuthCode($code)->getIdTokenString()
Decode JWT token or use Sign-in with Apple SDK.
统计信息
- 总下载量: 33.62k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 未知