* Removing :apple_auth feature flag and debugging * Fix tests failing due to nil in Devise initializer * Remove db/schema.rb changes * Devise config tweak * cleaning up * Fix spec + delete debug logs * Removes temporary beta_access_providers spec + remove feature flag DUS * Add test to avoid connecting an existing user with SIWA * Fix merge conflict mistake + more feature flag cleanups
75 lines
3.2 KiB
Markdown
75 lines
3.2 KiB
Markdown
---
|
|
title: Apple Authentication
|
|
---
|
|
|
|
# Sign in with Apple Authentication
|
|
|
|
Forem allows you to authenticate using
|
|
[Sign in with Apple](https://developer.apple.com/sign-in-with-apple/). In order
|
|
to use this authentication method you'll need to be enrolled to the
|
|
[Apple Developer Program](https://developer.apple.com/programs/) in order to
|
|
retrieve the necessary credentials and an HTTPS supported URL for the callback
|
|
configuration (HTTP won't work). Then you'll need to provide the keys to the
|
|
Rails application.
|
|
|
|
# Apple Developer Portal Configuration
|
|
|
|
[Register/Sign in](https://developer.apple.com/account) to your Apple Developer
|
|
Account.
|
|
|
|
## Service ID Configuration
|
|
|
|
1. [Create a Service ID](https://developer.apple.com/account/resources/identifiers/list/serviceId)
|
|
|
|

|
|
|
|
2. Name the Service and finalize the registration
|
|
|
|

|
|
|
|
3. Configure Domains and Subdomains & the callback URL. This example uses
|
|
[ngrok](https://ngrok.io) for HTTPS support.
|
|
|
|

|
|
|
|
## Key Configuration
|
|
|
|
1. [Register a new Key](https://developer.apple.com/account/resources/authkeys/add).
|
|
Enable the "Sign in with Apple" option and configure it so it's associated
|
|
with the corresponding App ID
|
|
|
|

|
|
|
|
2. Download the Key
|
|
|
|

|
|
|
|
# Configuring the Rails Application
|
|
|
|
Now with both the Service ID and Key you'll need to enable Apple Authentication
|
|
and pass in the credentials in the admin dashboard
|
|
`/admin/customization/config`.
|
|
|
|

|
|
|
|
Add the corresponding configuration data. Make sure the PEM key you downloaded
|
|
has explicit linebreaks (`\n`), don't forget the one at the very end of it.
|
|
|
|

|
|
|
|
Save the changes and restart your server for these values to take effect.
|
|
|
|
## Email configuration
|
|
|
|
Apple uses what they call Private Email Relay Service to hide user's emails. For
|
|
this to work first
|
|
[create a new email source](https://developer.apple.com/account/resources/services/list).
|
|
|
|

|
|
|
|
Emails sent need to be authenticated and the configuration depends on the
|
|
different providers available:
|
|
|
|
- [Mailchimp](https://mailchimp.com/help/set-up-custom-domain-authentication-dkim-and-spf/)
|
|
- [SendGrid](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
|
- [SES](https://docs.aws.amazon.com/es_es/ses/latest/DeveloperGuide/send-email-authentication-dkim.html)
|