PHPackages                             myshell/apple-laravel-authorization-code - 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. myshell/apple-laravel-authorization-code

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

myshell/apple-laravel-authorization-code
========================================

Get User Data with the result code of a apple sign in button

1.0.5(4y ago)0921↓75%MITPHP

Since Jun 8Pushed 4y agoCompare

[ Source](https://github.com/MyShellSoftwareLab/apple-laravel-authorization-code)[ Packagist](https://packagist.org/packages/myshell/apple-laravel-authorization-code)[ RSS](/packages/myshell-apple-laravel-authorization-code/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (6)Versions (8)Used By (0)

Validate Apple User Code with Laravel
=====================================

[](#validate-apple-user-code-with-laravel)

[![N|Solid](https://camo.githubusercontent.com/345210e6bf78ebd5e12ff11b2f3b1f8085474efa6d744f467d50be293e3988bd/68747470733a2f2f6d656469612e6c6963646e2e636f6d2f646d732f696d6167652f433444304241514576635779474d53395934672f636f6d70616e792d6c6f676f5f3230305f3230302f303f653d3231353930323434303026763d6265746126743d766c384d51594e326265616b646d423047573738383645555354777a56306f414b446d3456354d67506855)](https://camo.githubusercontent.com/345210e6bf78ebd5e12ff11b2f3b1f8085474efa6d744f467d50be293e3988bd/68747470733a2f2f6d656469612e6c6963646e2e636f6d2f646d732f696d6167652f433444304241514576635779474d53395934672f636f6d70616e792d6c6f676f5f3230305f3230302f303f653d3231353930323434303026763d6265746126743d766c384d51594e326265616b646d423047573738383645555354777a56306f414b446d3456354d67506855)

1. Installation
---------------

[](#1-installation)

```
composer require myshell/apple-laravel-authorization-code
```

Add Service Provider in config/app.php

```
'providers' => [
   ...
    AnimusCoop\AppleTokenAuth\AppleTokenAuthServiceProvider::class,
]

```

2. Configuration Setup
----------------------

[](#2-configuration-setup)

You will need to add an entry to the services configuration file so that after config files are cached for usage in production environment (Laravel command `artisan config:cache`) all config is still available.

To set up the required environment variables you can use the following artisan command which comes with this package.

```
php artisan socialite:apple

```

The command will prompt you the required values.You need to provide the following keys.

1. Team\_ID
2. Key\_ID
3. Client\_ID
4. Key ( file name of p8 auth file, located inside storage/app/ ) Example: AuthKey\_SAMPKEY.p8
5. Token Refresh Interval ( in days )

Client Secret will be automatically generated and added to the .env file by using the above command.

> The expiration time registered claim key, the value of which must not be greater than 15777000 (6 months in seconds) from the Current Unix Time on the server. [Sign in with Apple](https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens) Client Secret expiration time cannot be greater than six months. Hence it is advisible to refresh the Client Secret atleast once in six months after creation. You can adjust the Token Refresh Interval. There is a scheduled task which comes along with this package which will ensure that the Client Token is refreshed automatically. Please do ensure that you have enabled [Task Scheduling](https://laravel.com/docs/master/scheduling#introduction)

To manually refresh the Client Secret, please run the following command

```
php artisan apple:help --refresh

```

3. Use
------

[](#3-use)

Controller.

```
use AnimusCoop\AppleTokenAuth\Classes\AppleAuth;

```

```
$data = [
   "code" => "" //code sended by your front end guy
];

$appleAuth = new AppleAuth($data);

// if you need only the jwt signed with your p8 key file

// $jwt = $appleAuth->getJwtSigned();

// Refresh Token and get user Data
$user = $appleAuth->getUserData();

```

Response getUserData()

```
[
  "authorization" => {
    "access_token": ""
    "token_type": "Bearer"
    "expires_in": 3600
    "refresh_token": ""
    "id_token": ""
  }
  "user" => {
    "iss": "https://appleid.apple.com"
    "aud": "your client id"
    "exp": 1605393470
    "iat": 1605307070
    "sub": ""
    "at_hash": ""
    "email": "isaias@animus.com.ar"
    "email_verified": "true"
    "auth_time": 1605307067
    "nonce_supported": true
  }
]

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51.4% 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 ~65 days

Recently: every ~81 days

Total

6

Last Release

1480d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3693483d8b80be41c5af8ed9bae297f4301ed5773ece7bfe1ab466019ab7d940?d=identicon)[MyShell](/maintainers/MyShell)

---

Top Contributors

[![isa95Ar](https://avatars.githubusercontent.com/u/38536964?v=4)](https://github.com/isa95Ar "isa95Ar (19 commits)")[![JorgeSolisC](https://avatars.githubusercontent.com/u/42809436?v=4)](https://github.com/JorgeSolisC "JorgeSolisC (9 commits)")[![GussRw](https://avatars.githubusercontent.com/u/9169125?v=4)](https://github.com/GussRw "GussRw (7 commits)")[![cesarureno](https://avatars.githubusercontent.com/u/1313729?v=4)](https://github.com/cesarureno "cesarureno (2 commits)")

---

Tags

laravelapplejwt-phpApple Jwtapple-laravel-authorization-codesign in applecreate jwt apple phpcreate client\_secretrenew client\_secret

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/myshell-apple-laravel-authorization-code/health.svg)

```
[![Health](https://phpackages.com/badges/myshell-apple-laravel-authorization-code/health.svg)](https://phpackages.com/packages/myshell-apple-laravel-authorization-code)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[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/apple

Apple OAuth2 Provider for Laravel Socialite

618.4M8](/packages/socialiteproviders-apple)[robsontenorio/laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel

5161.1M3](/packages/robsontenorio-laravel-keycloak-guard)[jeremy379/laravel-openid-connect

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

55342.3k2](/packages/jeremy379-laravel-openid-connect)[ahilmurugesan/socialite-apple-helper

Laravel Socialite Apple Login Helper to generate and manage Client Secret

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

PHPackages © 2026

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