apple

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package apple is Sign in with Apple for identity: OpenID Connect with a nonce, the callback posted as a form, and a client secret the provider signs itself.

auth := identity.MustNew(cfg.Auth, d,
	identity.Providers(apple.New(cfg.Auth.Providers["apple"])))

It reads, from auth.providers.apple: client_id (the Services ID, such as com.example.web), client_secret (the PEM contents of the .p8 key made for Sign in with Apple — a secret, set it from the environment), team_id and key_id (ten characters each), redirect_url (a return URL of the Services ID: https://api.example.com/auth/apple/callback), scopes (name and email by default) and endpoint (the issuer, https://appleid.apple.com unless testing). It refuses hosted_domain.

Apple's quirks, handled here: the client secret is an ES256 JWT, signed with the .p8 key and cached for an hour; the callback is a form post across sites, so its cookies are SameSite=None and need https even in development; the user's name comes only with the first sign-in, in the form's user field; and a "hide my email" relay address is marked as aliased, so it never links to an existing account.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New returns the Apple provider for pc. A configuration it refuses — a key that is not an ECDSA P-256 .p8 key, among others — makes identity.New fail with the reason.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL