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 ¶
Types ¶
This section is empty.