How to sign in with apple for web with firebase

Issue #668

Authenticate Using Apple with JavaScript

Use Firebase JS SDK

Configure Sign in with Apple for the web

Go to Certificates, Identifiers & Profiles -> Identifier create 2 ids: App ID and Service ID

For example: I have App ID com.onmyway133.myapp and Service ID com.onmyway133.myweb

Screenshot 2020-06-16 at 09 20 34

Remember that to view App ID or Service ID, there’s dropdown menu on the right

Screenshot 2020-06-16 at 09 21 20

For App ID, enable

  • Associated Domains
  • Sign In with Apple: Enable it as Primary App ID

For Service ID, use firebase callback url

Associate domain

Add apple-app-site-association in public folder

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"applinks": {
"details": [
{
"appIDs": ["T78DK947F2.com.onmyway133.myapp"],
"components": [
{
"#": "no_universal_links",
"exclude": true,
"comment": "Matches any URL whose fragment equals no_universal_links and instructs the system not to open it as a universal link"
}
]
}
]
},
"webcredentials": {
"apps": [ "T78DK947F2.com.onmyway133.myweb" ]
}
}

Private key

Go to Keys and create new auth key. Configure that key with the primary App ID above

Screenshot 2020-06-16 at 09 24 05

Configure in Firebase

Go to Sign in providers and enable Apple sign in.

Fill in

  • Service ID identifier (com.onmyway133.myweb)
  • OAuth code flow configuration: fill in your team id, key id and key secret content.
Screenshot 2020-06-16 at 09 25 23

Comments