ArtisanPack UI
DocsApple OauthAPI Reference

API Reference

Apple Oauth v1.3.0

The public surface of . Sub-pages by class: - — the facade / helper root - — authorized HTTP requests + seam - — authorization-code flow - —...

The public surface of artisanpack-ui/apple-oauth.

Sub-pages by class:

The facade

use ArtisanPackUI\AppleOAuth\Facades\AppleOAuth;

AppleOAuth::oauth();         // OAuthManager
AppleOAuth::manager();       // AppleOAuthManager
AppleOAuth::clientSecret();  // ClientSecretGenerator
AppleOAuth::tokens();        // TokenManager
AppleOAuth::scopes();        // ScopeRegistry
AppleOAuth::client();        // AppleClient (stateless, since 1.1.0)
AppleOAuth::broker();        // BrokerClient (since 1.1.0)
AppleOAuth::usesBroker();    // bool (since 1.1.0)

oauth(), manager(), clientSecret(), tokens(), and scopes() return singletons that are shared across the request lifecycle. client() and broker() build a new client on every call, from the credentials you pass or from config. The AppleOAuth class itself just aggregates the managers so callers have a single entry point.

The helper

apple_oauth();   // same as app( 'apple-oauth' )

Returns the ArtisanPackUI\AppleOAuth\AppleOAuth instance. Equivalent to using the facade — pick whichever style matches your codebase.

Container bindings

The service provider registers:

Abstract Concrete Scope
apple-oauth ArtisanPackUI\AppleOAuth\AppleOAuth Singleton
ConfigurationRepository::class ConfigDriver / DatabaseDriver / CmsSettingsDriver (per apple-oauth.driver) Bind (re-resolved per lookup)
ConfigDriver::class ConfigDriver Singleton
DatabaseDriver::class DatabaseDriver Singleton
CmsSettingsDriver::class CmsSettingsDriver Singleton
ClientSecretGenerator::class ClientSecretGenerator Singleton
ScopeRegistry::class ScopeRegistry Singleton
OAuthManager::class OAuthManager Singleton
TokenManager::class TokenManager Singleton
TokenProvider::class OAuthTokenProvider Singleton
AppleOAuthManager::class AppleOAuthManager Singleton

Rebind ConfigurationRepository to swap in a custom credential driver. Rebind TokenProvider to swap in a fake for tests. The AppleOAuth aggregator is itself a singleton that stores its five manager instances at construction time — accessors return those stored references and do not re-resolve the container. Rebind ConfigurationRepository and TokenProvider before the first resolve of any singleton that consumes them (in a service provider's register(), or in test setup before touching the facade). Once a downstream manager has been constructed with the default binding, changing the binding has no effect on the already-cached instance.

Namespace map

ArtisanPackUI\AppleOAuth\
├── AppleOAuth.php                      — the aggregator
├── AppleOAuthManager.php               — authorized HTTP requests
├── AppleOAuthServiceProvider.php
├── helpers.php                         — apple_oauth() function
├── Facades\
│   └── AppleOAuth.php                  — facade
├── Configuration\
│   ├── ConfigDriver.php
│   ├── DatabaseDriver.php
│   └── CmsSettingsDriver.php
├── Contracts\
│   ├── ConfigurationRepository.php
│   └── TokenProvider.php
├── Broker\
│   ├── BrokerClient.php                — OAuth broker client (since 1.1.0)
│   └── BrokerCredentials.php
├── OAuth\
│   ├── OAuthManager.php
│   ├── AppleClient.php                 — stateless Apple primitives (since 1.1.0)
│   ├── AppleCredentials.php
│   ├── ClientSecretGenerator.php
│   ├── TokenResponse.php
│   └── AppleUserProfile.php
├── Scopes\
│   └── ScopeRegistry.php
├── Tokens\
│   ├── TokenManager.php
│   └── OAuthTokenProvider.php
├── Models\
│   └── AppleConnection.php
└── Exceptions\
    ├── Concerns\
    │   └── CarriesOAuthError.php       — getError() / getRenewUrl()
    ├── OAuthException.php
    ├── TokenRefreshException.php
    └── LicenseExpiredException.php     — extends TokenRefreshException

No public routes

The package does not ship any web routes. You own the connect and callback routes for your app. See OAuth Flow for wiring, and Broker Mode for the broker's GET callback.

Publish tags

Tag What it publishes
apple-oauth-config config/apple-oauth.php
apple-oauth-migrations Both migrations to database/migrations/.

Filter hooks

Hook Contract Purpose
ap.apple-oauth.scopes Filter — receives and returns array<int, string> Contribute scopes to the registry. Fires inside ScopeRegistry::all().
ap.apple-oauth.broker.credentials Filter — receives and returns array{url: ?string, site_id: ?string, site_secret: ?string} Supply broker credentials at runtime. Fires inside BrokerCredentials::fromConfig(). Since 1.1.0.

Continue to Testing →

Stay in the Loop

Monthly tips, tutorials and package updates — plus a free Quick Start cheat sheet.

Subscribe
Edit this page on GitHub