Will we know if we get a relay address from the user?

Will we be able to tell if we get a relay or forwarding address from the user vs. their real address?

Accepted Reply

Hi itskylem,


You should check the received email address against your existing accounts to prevent forking accounts. If that email address is found, link the received user identifier to that existing account. If you are unable to find the received email address in your existing accounts, you should create a new account.


The email you receive will always be a real verified email address that you can use to contact the user. You should not parse (or detect) if the received email is a relay email address because our relay domains may change in the future.

Replies

Yes, a relay email follows this format:

[code]@privaterelay.appleid.com

Just detect if the URL is privaterelay.appleid.com

Hi itskylem,


You should check the received email address against your existing accounts to prevent forking accounts. If that email address is found, link the received user identifier to that existing account. If you are unable to find the received email address in your existing accounts, you should create a new account.


The email you receive will always be a real verified email address that you can use to contact the user. You should not parse (or detect) if the received email is a relay email address because our relay domains may change in the future.

Hi Chew,


The email you receive will always be a real verified email address that you can use to contact the user. You should not parse (or detect) if the received email is a relay email address because our relay domains may change in the future.

Hi Patrick -


Do I understand this correctly, if I am an existing app user with an account that was made with the email address that is the same as my AppleID, the app should detect and merge that existing account when the new Sign in Apple action happens? If that's the case and I opt to not share my email (though I've technically done before the merge) would all future communications to my inbox come through the relay?

On Aug 21, 2019, bluedanish67 wrote:


> Do I understand this correctly, if I am an existing app user with an account that was made with the email address that is the same as my AppleID, the app should detect and merge that existing account when the new Sign in Apple action happens? If that's the case and I opt to not share my email (though I've technically done before the merge) would all future communications to my inbox come through the relay?


This is correct.


Prevent Duplicate Accounts

A user may already have an account in your system, but may attempt to use Sign in with Apple to log in to that account. Sharing the real email address that’s associated with the user’s Apple ID may not help, because it may not be the same email used to create the account with your system. There are a couple of ways you can mitigate this issue:

  • Implement the
    ASAuthorizationPasswordProvider
    class to detect and offer keychain credentials that the system already knows about. This works seamlessly to detect and use existing accounts, and prevents new accounts from being created using Sign in with Apple.
  • For new accounts created using Sign in with Apple, let the user know that they have created a new account, and ask if they have any existing accounts to link to.


For additional information about preventing duplicate accounts, see here.

For additional information about communicatig using the private email relay service, see here.