Download the PHP package yanlongli/php-apple-signin without Composer

On this page you can find all versions of the php package yanlongli/php-apple-signin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-apple-signin

Sign In with Apple for PHP — php-apple-signin

Latest Version PHP Version Downloads CI

Server-side PHP SDK for Sign In with Apple (通过 Apple 登录 / 苹果登录 / 苹果登陆). Verify Apple identity tokens (JWT) from iOS, macOS and the web using Apple's public JWKS, and generate the ES256 client_secret for the token and revoke REST endpoints.

PHP library to verify and parse Sign In with Apple identity tokens server side, following Apple's current REST API guidance (JWKS/RS256 signature verification, issuer/audience/nonce/expiry checks), and to generate the ES256 client_secret needed by the server-to-server endpoints.

PHP 服务端验证并解析「通过 Apple 登录」(苹果登录 / 苹果登陆)身份令牌(JWT)。支持从 iOS、macOS 及网页端获取的 Apple identity token(ASAuthorizationAppleIDCredential.identityToken / id_token),通过 Apple 官方 JWKS 公钥完成 RS256 签名验证,并严格按苹果最新文档校验签发者 iss、受众 aud(Bundle ID / Services ID)、nonce 与过期时间;同时提供 /auth/token、/auth/revoke 等服务端接口所需的 ES256 client_secret 生成器。可直接用于 Laravel、Symfony、Hyperf 等框架。

Parity replacement of the unmaintained griffinledingham/php-apple-signin(已停止维护的苹果登录库的替代实现).

Features / 功能特性

基于官方 JWKS 验证 JWT 签名;校验 iss/aud/nonce/exp;类型化读取用户标识、邮箱(含私有中继邮箱)、真实用户状态等;支持 PSR-16 缓存公钥、自定义 Guzzle;生成 ES256 client_secret;框架无关,原生 PHP / Laravel / Symfony / Hyperf 均可用。

Requirements / 环境要求

Installation / 安装

Verify an identity token / 验证身份令牌

The decoder performs every check recommended by Apple:

  1. RS256 signature against the live JWKS at https://appleid.apple.com/auth/keys (kid matched).
  2. iss === https://appleid.apple.com, exp/iat/nbf (120 s clock leeway by default).
  3. aud equals your client ID and, when supplied, nonce matches the session nonce.

解码器完整执行苹果要求的校验:基于 Apple JWKS 的 RS256 签名验证、签发者/过期时间校验、aud 客户端 ID 校验以及 nonce 防重放校验。

Available claim getters / Claim 读取方法

Method Claim
getIssuer() iss
getAudience() aud
getUserIdentifier() / getUser() sub
getEmail() email
isEmailVerified() email_verified (bool or "true")
isPrivateEmail() is_private_email
getNonce() nonce
isNonceSupported() nonce_supported
getRealUserStatus() real_user_status
getTransferSub() transfer_sub
getExpiresAt() / getIssuedAt() / getNotBefore() exp / iat / nbf
getClaim($name) / getClaims() raw access

Caching Apple public keys / 缓存 Apple 公钥

Apple keys rarely rotate and should be cached. Pass any PSR-16 cache:

A pre-fetched JWKS (JSON string, array, or an already parsed Key map) can be supplied through AppleSignIn\StaticPublicKeyProvider.

Generate a client_secret / 生成 client_secret

For the /auth/token and /auth/revoke endpoints, sign a JWT with the ES256 key (AuthKey_XXXXXXXXXX.p8) from Certificates, Identifiers & Profiles:

The private key may be a PEM string, the raw key body, or a .p8 path. The TTL is capped at Apple's 6-month limit (ClientSecretGenerator::MAX_TTL).

Migration from v1/v2 / 从旧版本迁移

The legacy static API still works and is backed by the new implementation:

It is deprecated: prefer AppleSignInDecoder (audience/nonce enforcement and proper exceptions).

Testing / 测试

FAQ / 常见问题

See doc/faq.md.

Search terms / 搜索关键词

Sign In with Apple PHP, Apple ID login PHP, Apple identity token verification, Apple JWT JWKS RS256 validation PHP, firebase/php-jwt Apple keys, ES256 client_secret generator, ASAuthorizationAppleIDCredential server validation, iOS 苹果登录 PHP SDK, 苹果账号登陆服务端验证, 苹果授权登录 token 校验, 替代 griffinledingham/php-apple-signin.

Changelog

v3.0

v2.0

Simplified decoding on top of firebase/php-jwt v6.

License

BSD-3-Clause


All versions of php-apple-signin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-json Version *
ext-openssl Version *
firebase/php-jwt Version ^7.0
guzzlehttp/guzzle Version ^7.8 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yanlongli/php-apple-signin contains the following files

Loading the files please wait ...