PHPackages                             socialiteproviders/apple - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. socialiteproviders/apple

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

socialiteproviders/apple
========================

Apple OAuth2 Provider for Laravel Socialite

5.9.0(3mo ago)618.4M—2.4%52[2 issues](https://github.com/SocialiteProviders/Apple/issues)8MITPHPPHP ^8.0

Since May 7Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/SocialiteProviders/Apple)[ Packagist](https://packagist.org/packages/socialiteproviders/apple)[ RSS](/packages/socialiteproviders-apple/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (27)Used By (8)

Apple
=====

[](#apple)

```
composer require socialiteproviders/apple
```

Installation &amp; Basic Usage
------------------------------

[](#installation--basic-usage)

Please see the [Base Installation Guide](https://socialiteproviders.com/usage/), then follow the provider specific instructions below.

### Add configuration to `config/services.php`

[](#add-configuration-to-configservicesphp)

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

See [Configure Apple ID Authentication](https://developer.okta.com/blog/2019/06/04/what-the-heck-is-sign-in-with-apple)

> Note: the client secret used for "Sign In with Apple" is a JWT token that can have a maximum lifetime of 6 months. The article above explains how to generate the client secret on demand and you'll need to update this every 6 months. To generate the client secret for each request, see [Generating A Client Secret For Sign In With Apple On Each Request](https://bannister.me/blog/generating-a-client-secret-for-sign-in-with-apple-on-each-request)

If you don't have secret token, or you don't want to it do manually, you can use a private key ([see official docs](https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens#3262048)). Add lines to the configuration as follows:

```
'apple' => [
  'client_id' => env('APPLE_CLIENT_ID'), // Required. Bundle ID from Identifier in Apple Developer.
  'client_secret' => env('APPLE_CLIENT_SECRET'), // Empty. We create it from private key.
  'key_id' => env('APPLE_KEY_ID'), // Required. Key ID from Keys in Apple Developer.
  'team_id' => env('APPLE_TEAM_ID'), // Required. App ID Prefix from Identifier in Apple Developer.
  'private_key' => env('APPLE_PRIVATE_KEY'), // Required. Must be absolute path, e.g. /var/www/cert/AuthKey_XYZ.p8
  'passphrase' => env('APPLE_PASSPHRASE'), // Optional. Set if your private key have a passphrase.
  'signer' => env('APPLE_SIGNER'), // Optional. Signer used for Configuration::forSymmetricSigner(). Default: \Lcobucci\JWT\Signer\Ecdsa\Sha256
  'redirect' => env('APPLE_REDIRECT_URI') // Required.
],
```

If you receive error `400 Bad Request {"error":"invalid_client"}` , a possible solution is to use another Signer (Asymmetric algorithms), see [Asymmetric algorithms](https://lcobucci-jwt.readthedocs.io/en/stable/supported-algorithms/#asymmetric-algorithms).

### Add provider event listener

[](#add-provider-event-listener)

#### Laravel 11+

[](#laravel-11)

In Laravel 11, the default `EventServiceProvider` provider was removed. Instead, add the listener using the `listen` method on the `Event` facade, in your `AppServiceProvider` `boot` method.

- Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.

```
Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
    $event->extendSocialite('apple', \SocialiteProviders\Apple\Provider::class);
});
```

Laravel 10 or below Configure the package's listener to listen for `SocialiteWasCalled` events. Add the event to your `listen[]` array in `app/Providers/EventServiceProvider`. See the [Base Installation Guide](https://socialiteproviders.com/usage/) for detailed instructions.

```
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\Apple\AppleExtendSocialite::class.'@handle',
    ],
];
```

### Usage

[](#usage)

You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):

```
return Socialite::driver('apple')->redirect();
```

### Returned User fields

[](#returned-user-fields)

- `id`
- `name`
- `email`

### Reference

[](#reference)

- [Apple API Reference](https://developer.apple.com/documentation/signinwithapplerestapi/)

###  Health Score

66

—

FairBetter than 99% of packages

Maintenance82

Actively maintained with recent releases

Popularity61

Solid adoption and visibility

Community36

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~85 days

Recently: every ~209 days

Total

26

Last Release

57d ago

Major Versions

v3.0.4 → 4.0.02020-10-25

4.1.1 → 5.0.02021-01-05

PHP version history (4 changes)v3.0.2PHP ^7.2

4.1.0PHP ^7.2 || ^8.0

5.0.0PHP ^7.4 || ^8.0

5.6.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/65eb3a7ba2a2c13b3a9de48b836caf759ad4052f9a839e30464c80d177d5b3d2?d=identicon)[atymic](/maintainers/atymic)

---

Top Contributors

[![lucasmichot](https://avatars.githubusercontent.com/u/513603?v=4)](https://github.com/lucasmichot "lucasmichot (15 commits)")[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (13 commits)")[![damonto](https://avatars.githubusercontent.com/u/9162521?v=4)](https://github.com/damonto "damonto (3 commits)")[![hamrak](https://avatars.githubusercontent.com/u/5807028?v=4)](https://github.com/hamrak "hamrak (3 commits)")[![saundefined](https://avatars.githubusercontent.com/u/4685504?v=4)](https://github.com/saundefined "saundefined (2 commits)")[![pyrou](https://avatars.githubusercontent.com/u/235005?v=4)](https://github.com/pyrou "pyrou (2 commits)")[![golsson](https://avatars.githubusercontent.com/u/1913770?v=4)](https://github.com/golsson "golsson (1 commits)")[![guillaumeboussion](https://avatars.githubusercontent.com/u/91058384?v=4)](https://github.com/guillaumeboussion "guillaumeboussion (1 commits)")[![harrowmykel](https://avatars.githubusercontent.com/u/22492933?v=4)](https://github.com/harrowmykel "harrowmykel (1 commits)")[![HazemKhaled](https://avatars.githubusercontent.com/u/125433?v=4)](https://github.com/HazemKhaled "HazemKhaled (1 commits)")[![jryd](https://avatars.githubusercontent.com/u/13251203?v=4)](https://github.com/jryd "jryd (1 commits)")[![kimdolong](https://avatars.githubusercontent.com/u/2102349?v=4)](https://github.com/kimdolong "kimdolong (1 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (1 commits)")[![maks-oleksyuk](https://avatars.githubusercontent.com/u/90793591?v=4)](https://github.com/maks-oleksyuk "maks-oleksyuk (1 commits)")[![masticore252](https://avatars.githubusercontent.com/u/18010476?v=4)](https://github.com/masticore252 "masticore252 (1 commits)")[![Max13](https://avatars.githubusercontent.com/u/531249?v=4)](https://github.com/Max13 "Max13 (1 commits)")[![orhan-swe](https://avatars.githubusercontent.com/u/10519489?v=4)](https://github.com/orhan-swe "orhan-swe (1 commits)")[![rcerljenko](https://avatars.githubusercontent.com/u/16762056?v=4)](https://github.com/rcerljenko "rcerljenko (1 commits)")[![robiiinos](https://avatars.githubusercontent.com/u/16455953?v=4)](https://github.com/robiiinos "robiiinos (1 commits)")[![RomainLanz](https://avatars.githubusercontent.com/u/2793951?v=4)](https://github.com/RomainLanz "RomainLanz (1 commits)")

---

Tags

laraveloauthoauth1oauth2social-mediasocialitesocialite-providerslaravelprovideroauthsocialiteapplelaravel socialitesign in with applesocialite appleclient key generatorclient key refreshapple client keyapple sign inlaravel apple

### Embed Badge

![Health badge](/badges/socialiteproviders-apple/health.svg)

```
[![Health](https://phpackages.com/badges/socialiteproviders-apple/health.svg)](https://phpackages.com/packages/socialiteproviders-apple)
```

###  Alternatives

[ahilmurugesan/socialite-apple-helper

Laravel Socialite Apple Login Helper to generate and manage Client Secret

13120.7k](/packages/ahilmurugesan-socialite-apple-helper)[socialiteproviders/microsoft

Microsoft OAuth2 Provider for Laravel Socialite

326.1M13](/packages/socialiteproviders-microsoft)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[socialiteproviders/instagram

Instagram OAuth2 Provider for Laravel Socialite

421.9M5](/packages/socialiteproviders-instagram)[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

2073.7k](/packages/kovah-laravel-socialite-oidc)[nerdzlab/socialite-apple-sign-in

Extension of laravel/socialite package. Adds apple provider to sign in.

1844.3k](/packages/nerdzlab-socialite-apple-sign-in)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
