AppleProviderOptions class

Configuration for the Apple OAuth provider.

Callback URL

https://example.com/auth/callback/apple

Usage

import 'package:server_auth/server_auth.dart';
import 'package:server_auth/server_auth.dart';

final manager = AuthManager(
  AuthOptions(
    store: InMemoryAuthStore(),
    storeMode: AuthStoreMode.ephemeral,
    providers: [
      appleProvider(
        AppleProviderOptions(
          clientId: env('APPLE_CLIENT_ID'), // Service ID
          clientSecret: env('APPLE_CLIENT_SECRET'), // Generated JWT
          redirectUri: 'https://example.com/auth/callback/apple',
        ),
      ),
    ],
  ),
);

Notes

  • Uses OpenID Connect.
  • clientId is your Services ID (not Bundle ID).
  • clientSecret is a JWT signed with your private key.
  • User name is only returned on first sign-in, you must store it.
  • Apple may return a private relay email address.

Constructors

AppleProviderOptions({required String clientId, required String clientSecret, required String redirectUri, List<String> scopes = const ['name', 'email']})
Creates a new AppleProviderOptions configuration.
const

Properties

clientId String
Services ID (not Bundle ID).
final
clientSecret String
JWT signed with your Apple private key.
final
hashCode int
The hash code for this object.
no setterinherited
redirectUri String
The URI to redirect to after authentication.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scopes List<String>
OAuth scopes to request. Defaults to ['name', 'email'].
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited