PHPackages                             lade-devs/socialite-apple-jwt-generator - 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. lade-devs/socialite-apple-jwt-generator

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

lade-devs/socialite-apple-jwt-generator
=======================================

Laravel Socialite Apple Login Helper to generate and manage Client Secret

v1.0.1(1mo ago)0347↑37.5%MITPHPPHP ^8.3CI passing

Since Jun 4Pushed 1mo agoCompare

[ Source](https://github.com/lade-devs/socialite-apple-jwt-generator)[ Packagist](https://packagist.org/packages/lade-devs/socialite-apple-jwt-generator)[ RSS](/packages/lade-devs-socialite-apple-jwt-generator/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

socialite-apple-jwt-generator
=============================

[](#socialite-apple-jwt-generator)

[![Latest Stable Version](https://camo.githubusercontent.com/efe9cc6184e27fe23b7bafc17eef9177efad829d1cbe3825296f32929e6c8ccc/68747470733a2f2f706f7365722e707567782e6f72672f6c6164652d646576732f736f6369616c6974652d6170706c652d6a77742d67656e657261746f722f762f737461626c65)](https://packagist.org/packages/lade-devs/socialite-apple-jwt-generator)[![Total Downloads](https://camo.githubusercontent.com/89b810c4f806ec2bb5521e23e1fab302c670408728b203b29a7a2f6ff1b28fe4/68747470733a2f2f706f7365722e707567782e6f72672f6c6164652d646576732f736f6369616c6974652d6170706c652d6a77742d67656e657261746f722f646f776e6c6f616473)](https://packagist.org/packages/lade-devs/socialite-apple-jwt-generator)[![Tests](https://github.com/lade-devs/socialite-apple-jwt-generator/actions/workflows/tests.yml/badge.svg)](https://github.com/lade-devs/socialite-apple-jwt-generator/actions)[![License](https://camo.githubusercontent.com/a481b1b05ba42e3edeb798fa9e524a0dc6cd9b0695bf96aa28d6d908a275dd88/68747470733a2f2f706f7365722e707567782e6f72672f6c6164652d646576732f736f6369616c6974652d6170706c652d6a77742d67656e657261746f722f6c6963656e7365)](https://packagist.org/packages/lade-devs/socialite-apple-jwt-generator)

Laravel Socialite helper to **generate and auto-refresh** the Apple Sign-In client secret — a signed **ES256 JWT** required by Apple's OAuth flow.

> Apple enforces a **maximum 6-month (180-day) expiry** on client secrets.
> This package handles generation, storage in `.env`, and scheduled automatic refresh.

---

Requirements
------------

[](#requirements)

VersionPHP^8.3Laravel^12.0lcobucci/jwt^5.6---

Installation
------------

[](#installation)

```
composer require lade-devs/socialite-apple-jwt-generator
```

Laravel's package auto-discovery registers the service provider automatically.

---

Apple Developer Setup
---------------------

[](#apple-developer-setup)

You will need the following from the [Apple Developer Portal](https://developer.apple.com/account):

1. **Team ID** – found under *Membership*.
2. **Key ID** – found under *Certificates, Identifiers &amp; Profiles → Keys*.
3. **Client ID** – your *Services ID* identifier (e.g. `com.example.signin`).
4. **Auth Key file** (`.p8`) – downloaded when you create the key.
    Place it inside `storage/app/` and note the filename, e.g. `AuthKey_ABCDEF1234.p8`.
5. **Redirect URI** – the fully-qualified HTTPS callback URL registered in your Services ID.

---

Configuration
-------------

[](#configuration)

### 1. Run the interactive setup

[](#1-run-the-interactive-setup)

```
php artisan socialite:apple
```

The command prompts for all five values above plus a refresh interval (default **180 days**), generates the client secret JWT, and writes everything to `.env`.

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

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

This ensures values survive `php artisan config:cache` in production:

```
'apple' => [
    'client_id'                   => env('APPLE_CLIENT_ID'),
    'client_secret'               => env('APPLE_CLIENT_SECRET'),
    'redirect'                    => env('APPLE_REDIRECT_URI'),
    'key_id'                      => env('APPLE_KEY_ID'),
    'team_id'                     => env('APPLE_TEAM_ID'),
    'auth_key'                    => env('APPLE_AUTH_KEY'),
    'client_secret_updated_at'    => env('APPLE_CLIENT_SECRET_UPDATED_AT'),
    'refresh_token_interval_days' => env('APPLE_REFRESH_TOKEN_INTERVAL_DAYS', 180),
],
```

---

Automatic Secret Refresh
------------------------

[](#automatic-secret-refresh)

The package registers a scheduled task that checks every minute whether the secret is due for renewal based on `APPLE_REFRESH_TOKEN_INTERVAL_DAYS` and `APPLE_CLIENT_SECRET_UPDATED_AT`.

Make sure [Laravel's task scheduler](https://laravel.com/docs/scheduling#introduction) is running:

```
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
```

### Manual refresh

[](#manual-refresh)

```
php artisan socialite:apple --refresh
```

---

Environment Variables
---------------------

[](#environment-variables)

VariableDescription`APPLE_CLIENT_ID`Your Services ID`APPLE_CLIENT_SECRET`Generated JWT (managed by this package)`APPLE_REDIRECT_URI`OAuth callback URL`APPLE_KEY_ID`Key ID from the developer portal`APPLE_TEAM_ID`Team ID from the developer portal`APPLE_AUTH_KEY`Filename of the `.p8` key in `storage/app/``APPLE_CLIENT_SECRET_UPDATED_AT`Unix timestamp of last generation (auto-managed)`APPLE_REFRESH_TOKEN_INTERVAL_DAYS`Days between refreshes (1–180, default 180)---

Running Tests
-------------

[](#running-tests)

```
composer install
vendor/bin/phpunit
```

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

---

License
-------

[](#license)

MIT © [LadeDevs](mailto:olumayokunolayinka@gmail.com)

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance90

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~0 days

Total

2

Last Release

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f40afd2cfeaaad31bb635d0cd24c99c02b0ff613dc5ef5177c45e5bf63af9375?d=identicon)[lade-devs](/maintainers/lade-devs)

---

Top Contributors

[![lade-devs](https://avatars.githubusercontent.com/u/41644496?v=4)](https://github.com/lade-devs "lade-devs (8 commits)")

---

Tags

laravelsocialiteapplelaravel socialitesign in with applesocialite appleclient key generatorclient key refreshapple client keyapple sign inlaravel apple

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lade-devs-socialite-apple-jwt-generator/health.svg)

```
[![Health](https://phpackages.com/badges/lade-devs-socialite-apple-jwt-generator/health.svg)](https://phpackages.com/packages/lade-devs-socialite-apple-jwt-generator)
```

###  Alternatives

[socialiteproviders/apple

Apple OAuth2 Provider for Laravel Socialite

629.5M18](/packages/socialiteproviders-apple)[ahilmurugesan/socialite-apple-helper

Laravel Socialite Apple Login Helper to generate and manage Client Secret

13122.4k](/packages/ahilmurugesan-socialite-apple-helper)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

61437.0k9](/packages/jeremy379-laravel-openid-connect)[nerdzlab/socialite-apple-sign-in

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

1947.7k](/packages/nerdzlab-socialite-apple-sign-in)[schedula/laravel-passport-socialite

The missing laravel passport feature for social authentication

4922.6k](/packages/schedula-laravel-passport-socialite)

PHPackages © 2026

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