seoda/socialite-apple

Laravel Socialite 的 Apple OAuth2 提供商

v0.1.1 2019-06-26 02:20 UTC

This package is auto-updated.

Last update: 2024-09-26 14:11:14 UTC


README

** 此组件正在开发中。 **

要求

  • PHP >= 7.1.3
  • Laravel >= 5.7

使用

在 Apple 开发者门户中准备

在 Apple 开发者门户中创建 App ID、服务 ID 和客户端身份验证的私钥。

参见:入门 - 使用 Apple 登录 - Apple 开发者

安装

composer require seoda/socialite-apple

配置

config/services.php

'apple' => [
    'client_id' => env('APPLE_CLIENT_ID'),
    'client_secret' => env('APPLE_CLIENT_SECRET'),
    'redirect' => env('APPLE_REDIRECT'),
]

.env

APPLE_CLIENT_ID=
APPLE_CLIENT_SECRET=
APPLE_REDIRECT=

实现

// Redirect to Sign in with Apple in controller.
return Socialite::driver('apple')->redirect();

// Handle callback, fetch user information from `code` in controller.
$user = Socialite::driver('apple')->user();

限制

  • getUserByToken() 目前尚未实现。
    • 这意味着您无法获取 nameemail 字段。
    • 我们等待来自 Apple 的更多信息。

许可协议

socialite-apple 是开源软件,使用 MIT 许可协议 许可。