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

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

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

{
  "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

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.

Updated at 2020-06-16 07:27:18