![]() For iOS, you need to do one more bit of configuration to allow your app to use the Sign-in with Apple functionality ("capability" in Apple parlance). On Android you should be good to go (the auth code should just work). ![]() It's what Firebase needs to be your "auth server as a service" for login on Android devices. p8 file that you downloaded when you created your key. Key ID is the key you created before (e.g., T28DD93GJ69).Apple team ID is the "App ID Prefix (Team ID)" from the App ID page (e.g, L2L8TM8R9PR).Services ID is the service ID you created before (e.g.Now you need to give Firebase all the stuff you just went and created in the Apple Developer Console. ![]() Then go to the Sign-in method tab and click the "Add new provider" button. Login to your Firebase console and then go to Build -> Authentication. Now Apple knows how to talk to Firebase, but we need to make sure that Firebase knows how to talk to Apple on your behalf. Enable Apple sign-in in the Firebase console In Return URLs, add your special Firebase URL. Under website URLs, there are two big boxes. Under "Primary App ID", choose the App ID you created earlier. Once there, check the checkbox next to "Sign in with Apple". In the top right corner (that says App IDs), choose Service IDs.Ĭlick on the Service ID you created earlier. To do this, go back to the identifiers page ( ). For this, there's a special URL that Firebase creates for you ( ) but we need to give that to Apple. It turns out that Firebase can handle the redirects for you, but you need to make sure to tell Apple how to talk to Firebase. Now that we have all the pieces created, we can start stitching them together with Firebase. Save this for later because you won't be able to download it again (and you'll need to give it to Firebase). Once you have that, download the key itself (it's a. Whoops.Ĭheck the checkbox next to "Sign in with Apple" and then click "Configure".įor the Primary App ID, choose the App ID you created earlier. It's ugly and tougher to read, but keys cannot have the common special characters that make this stuff readable. To keep things simple, I use the App ID without any dots (e.g., if your App ID is, I'd make the key ID be commyappbundleid. Click the little plus sign next to "Keys"Ĭhoose a key name. Once there, check the box for "Sign In with Apple". On the list of Services, click on the one you just created (like you're going to edit it). On the next page, confirm everything looks OK (check for typos) and click Register. To keep things simple for future me, I chose (in other words, I took the App ID from before and added. For the ID, you have to choose something unique. For description, write whatever you want that will help you remember what app this is associated with (you can always change this later). Scroll back up and click Register to finish off this part. Apparently this means other stuff that we'll do in the future (e.g., creating Services and whatnot) will be hooked up to this App ID. It should automatically say "Enable as Primary App ID". Then scroll down for a while and check the box next to "Sign In with Apple". Put whatever you want for the description (you can always change this later) and choose a reverse-domain style ID for the Bundle ID (e.g., ) I'm not sure what an App Clip is.) Then click Continue.Įnter in the basic details for your App. Choose App IDs on the next page and click Continue.Ĭhoose App (not App Clip) on the next page. Start by going to (you should see "App IDs" in the top right corner).Ĭlick the plus sign next to Identifiers to create a new one. Ultimately you'll get access to the Apple Developer stuff. Pay them some money, wait 48 hours, maybe send them a copy of your government ID, etc. Start by going to to sign up for an Apple Developer account. Write two lines of Dart to sign in with Apple (and then some more to actually do something with the user credential).(on iOS) Add the "capability" (like Permissions in Android) for Sign In with Apple.Give Firebase all these IDs and keys so that it can talk to Apple on your behalf.Enable Apple sign-in in the Firebase console.Set your "return URL" so that Apple knows to talk to Firebase.Sign up for an Apple Developer account (this takes time and is long, so we'll assume you already have an account).Luckily you do this once for your app and (hopefully) never again. Note that it's 95% configuration, clicking, choosing IDs, and copying/pasting stuff. Here's a quick overview of what you have to do to make Apple happy and allow Sign-in with Apple. (Firebase team, if you're reading this, maybe try out your own documentation? Or copy/paste this – that's fine by me.) The code for this is dead simple, which is great, but the documentation for configuration is embarrassingly bad, so I'm writing this down.
0 Comments
Leave a Reply. |