apple_sign_in_plugin 1.0.10 copy "apple_sign_in_plugin: ^1.0.10" to clipboard
apple_sign_in_plugin: ^1.0.10 copied to clipboard

A comprehensive Flutter package for integrating Apple Sign-In with features for secure authentication and user data management.

Apple Sign In Plugin #

A comprehensive Flutter package for integrating Apple Sign-In with features for secure authentication and user data management.

pub package

Features #

  • Easy Apple Sign-In integration
  • Secure authentication handling
  • Automatic token management
  • Cross-platform support
  • Persistent authentication state
  • User information retrieval
  • Dynamic client secret generation

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  apple_sign_in_plugin: ^latest_version
copied to clipboard

Platform Setup #

Note: This plugin may not work on simulators.

For detailed platform-specific configuration (Android, iOS, macOS, web), please refer to the sign_in_with_apple package documentation, as this plugin is based on it.

Prerequisites #

Before using this plugin, you'll need the following identifiers from your Apple Developer account:

  • TeamID (AppID prefix): Found in your App ID identifiers
  • KeyID: Available in the keys section when downloading your private key
  • BundleID: Your App Bundle ID in Apple's ecosystem
  • Private Key: Download the .p8 file (can only be downloaded once)
    • Recommended: Rename the file to apple_private_key.pem
    • Also add this file in asset folder and assign path in pubspec.yaml
    • ex: assets/keys/apple_private_key.pem

Usage #

Initialization #

await AppleSignInPlugin.initialize(
    pemKeyPath: 'path/to/your/apple_private_key.pem',
    keyId: 'your-key-id',
    teamId: 'your-team-id',
    bundleId: 'your-bundle-id',
);
copied to clipboard

Sign In #

final credential = await AppleSignInPlugin.signInWithApple();
copied to clipboard

Sign Out #

await AppleSignInPlugin.signOut();
copied to clipboard

How It Works #

User Information Retrieval #

The plugin automatically retrieves and manages user email and name during the Apple Sign-In process, ensuring consistent data availability for your application.

Token Management #

The plugin handles:

  • Automatic access token revocation and regeneration
  • Prevention of null user data in subsequent logins
  • Secure token lifecycle management

Client Secret Generation #

  • Automatically generates client secrets using private keys
  • Ensures secure communication with Apple's authentication services
  • No manual client secret handling required

Implementation Details #

Authentication Flow #

  1. Initial token retrieval via https://appleid.apple.com/auth/token
  2. Automatic token revocation using https://appleid.apple.com/auth/revoke
  3. Dynamic client secret generation for secure authentication

Contributing #

Contributions are welcome! Please feel free to submit a Pull Request.

License #

This project is licensed under the MIT License - see the LICENSE file for details.

Support #

If you encounter any issues or have questions, please file them on the GitHub repository.

12
likes
160
points
194
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.14 - 2025.03.29

A comprehensive Flutter package for integrating Apple Sign-In with features for secure authentication and user data management.

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter, get_storage, http, jose, sign_in_with_apple

More

Packages that depend on apple_sign_in_plugin