PHPackages                             currencyfair/apple-sign-in-php-client - 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. currencyfair/apple-sign-in-php-client

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

currencyfair/apple-sign-in-php-client
=====================================

PHP Client for Apple Sign-In

v1.0.0(6y ago)1497.8k↓23.6%10[1 PRs](https://github.com/CurrencyFair/Apple-Sign-In-PHP-Client/pulls)Apache-2.0PHPPHP &gt;=5.6

Since Apr 23Pushed 2y ago12 watchersCompare

[ Source](https://github.com/CurrencyFair/Apple-Sign-In-PHP-Client)[ Packagist](https://packagist.org/packages/currencyfair/apple-sign-in-php-client)[ RSS](/packages/currencyfair-apple-sign-in-php-client/feed)WikiDiscussions master Synced 1mo ago

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

Apple Sign-In PHP Client
========================

[](#apple-sign-in-php-client)

[![PHPUnit Test Suite](https://github.com/CurrencyFair/Apple-Sign-In-PHP-Client/workflows/PHPUnit%20Test%20Suite/badge.svg)](https://github.com/CurrencyFair/Apple-Sign-In-PHP-Client/workflows/PHPUnit%20Test%20Suite/badge.svg)

Features Include:

- Generating an Apple authorisation link to use with your Sign-In button
- Verifying and decoding Apple JWTs
- Verifying Apple Authorisation Codes and exchanging them with Apple's API for access/refresh tokens
- Automatic fetching of Apple's public keys and generating of client secrets.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage &amp; Examples](#usage--examples)
    - [Verify Auth Code &amp; Fetching Access/Refresh Tokens](#verifying-an-authorisation-code-and-retrieving-the-accessrefresh-tokens)
    - [Verifying &amp; Decoding Apple's JWTs](#verifying-and-decoding-apple-jwts)
    - [Generating an Authorisation URL for your Sign-In button](#generating-an-authorisation-url-for-your-sign-in-button)
    - [End-to-End Sign-In page &amp; Return Page](#end-to-end-sign-in-page--return-page)
- [FAQ &amp; Troubleshooting](#faq--troubleshooting)
- [Useful Links](#useful-links)
- [License](#license)

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

[](#installation)

```
composer require currencyfair/apple-sign-in-php-client
```

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

[](#configuration)

Config KeyDescriptionclientIdAlso referred to as Service ID. This can be found [here](https://developer.apple.com/account/resources/identifiers/list/serviceId).privateKeyThe is required to generate the `Client Secret` which is used to verify Authorisation Codes. You can pass a string or the path to the key file. The key can be created and downloaded [here](https://developer.apple.com/account/resources/authkeys/list).keyIdThe ID associated with the above `privateKey`. This should be available on the page where you downloaded your private key.teamIdThis is usually found in the top right corner under your name in the Apple Developer area.redirectUriThis is the web page users will be redirect to after (un)successful sign-in. This address must be HTTPS and cannot be localhost. See FAQ for localhost workaround.defaultScopesThese are the scopes you would like returned from Apple. Apple only supports `name` and `email`.apiKeysEndpoint (optional)URL containing Apple's public key in [JWK format](https://tools.ietf.org/html/rfc7517). Unless you have a reason to change this the default should be fine.apiTokenEndpoint (optional)The endpoint used to verify Authorisation Codes. Unless you have a reason to change this the default should be fine.apiAuthEndpoint (optional)The authorisation URL used to build the URL users will sign in on. Unless you have a reason to change this the default should be fine.See below for examples of passing config values.

Usage &amp; Examples
--------------------

[](#usage--examples)

### Verifying an Authorisation Code and retrieving the access/refresh tokens

[](#verifying-an-authorisation-code-and-retrieving-the-accessrefresh-tokens)

```
