Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ flutter run \

This approach is useful when you need to:

- Manage separate client IDs for different platforms (Android, iOS, Web) in a centralized way
- Manage separate client IDs for different platforms (Android, iOS, web) in a centralized way
- Avoid committing client IDs to version control
- Configure different credentials for different build environments (development, staging, production)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Go through this before investigating a specific error. Most problems come from a
- [ ] Surface Google sign-in in the UI with `SignInWidget` or `GoogleSignInWidget` (see [Present the authentication UI](./setup#present-the-authentication-ui)).
- [ ] Create an **iOS** OAuth client in the **same** Google Cloud project as the Web client, using the same **Bundle ID** as the app. Set `GIDClientID` from the iOS client, `GIDServerClientID` to the **Web** client's ID, and add the reversed-client-ID **URL scheme** in `Info.plist` (*iOS only*).
- [ ] Create an **Android** OAuth client in the **same** project, with the same **package name** and **SHA-1** as the build you run (*Android only*).
- [ ] Set up the web callback (*Web only*). Pick one:
- [ ] Set up the web callback (*web only*). Pick one:
- **Standard:** Register `FlutterWebAuth2CallbackRoute` on `pod.webServer` in `server.dart` before `pod.start()` per [Web setup](./setup#web).
- **Separately-hosted fallback:** Create `web/auth.html` in your Flutter project as described in [Web callback page (`auth.html`)](../../setup#web-callback-page-authhtml) and run Flutter on a **fixed** `--web-port` so the origin does not change every run. See [separately-hosted Flutter web](./customizations#separately-hosted-flutter-web).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sidebar_label: Setup
description: Sign in with Apple requires Apple credentials and platform setup. Register them and add the provider to your Serverpod app across iOS, macOS, Android, and Web.
description: Sign in with Apple requires Apple credentials and platform setup. Register them and add the provider to your Serverpod app across iOS, macOS, Android, and web.
---

# Set up Apple sign-in
Expand Down Expand Up @@ -237,7 +237,7 @@ This intent filter is required. Without it, the OAuth callback never returns to

### Web

Sign in with Apple on Web requires the Apple JS SDK. Add the following script to your Flutter app's `web/index.html` inside the `<head>` tag:
Sign in with Apple on web requires the Apple JS SDK. Add the following script to your Flutter app's `web/index.html` inside the `<head>` tag:

```html
<script type="text/javascript" src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js" crossorigin="anonymous"></script>
Expand Down Expand Up @@ -301,7 +301,7 @@ This renders a Sign in with Apple button like this:

The widget automatically handles:

- Sign in with Apple flow for iOS, macOS, Android, and Web.
- Sign in with Apple flow for iOS, macOS, Android, and web.
- Token management.
- Underlying `sign_in_with_apple` package error handling.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ When a user revokes access from their Apple ID settings, Apple sends a notificat
| `teamId` | `String` | Yes | `appleTeamId` | The 10-character Team ID from your Apple Developer account. Used to sign the client secret JWT. |
| `keyId` | `String` | Yes | `appleKeyId` | The Key ID of the Sign in with Apple private key. |
| `key` | `String` | Yes | `appleKey` | The raw contents of the `.p8` private key file, including the `-----BEGIN PRIVATE KEY-----` header and footer. Do not pre-generate the JWT yourself. |
| `webRedirectUri` | `String?` | Web only | `appleWebRedirectUri` | The web app URL the browser is redirected to after the server receives Apple's callback. |
| `webRedirectUri` | `String?` | web only | `appleWebRedirectUri` | The web app URL the browser is redirected to after the server receives Apple's callback. |
| `androidPackageIdentifier` | `String?` | Android only | `appleAndroidPackageIdentifier` | The Android package name (e.g. `com.example.app`). When set, the callback route redirects Android sign-ins back to the app via an intent URI. |

## App configuration
Expand Down Expand Up @@ -144,7 +144,7 @@ flutter run \

This approach is useful when you need to:

- Manage configuration separately for different platforms (Android, Web) in a centralized way
- Manage configuration separately for different platforms (Android, web) in a centralized way
- Avoid committing sensitive configuration to version control
- Configure different credentials for different build environments (development, staging, production)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Go through this before investigating a specific error. Most problems come from a
* [ ] Add `serverpod_auth_idp_flutter` to your Flutter app's `pubspec.yaml`.
* [ ] Add `client.auth.initializeAppleSignIn()` after `client.auth.initialize()` in your Flutter app's `main.dart`.
* [ ] Add **Sign in with Apple** under Signing & Capabilities in Xcode (*iOS/macOS only*).
* [ ] Add the **Apple JS SDK** script to `web/index.html` (*Web only*).
* [ ] Add the **Apple JS SDK** script to `web/index.html` (*web only*).
* [ ] Pass **`APPLE_SERVICE_IDENTIFIER`** and **`APPLE_REDIRECT_URI`** via `--dart-define`. Initialization throws an `ArgumentError` without them, on every platform.
* [ ] Add the **`signinwithapple`** intent filter to `AndroidManifest.xml` (*Android only*).
* [ ] Add **Apple's mail servers** to your SPF record if you email users who might use Hide My Email.
Expand Down Expand Up @@ -81,7 +81,7 @@ Alternatively, set `appleKey` via the `SERVERPOD_PASSWORD_appleKey` environment

## Wrong identifier passed for web or Android sign-in

**Problem:** Sign-in on Android or Web fails immediately, or Apple returns `invalid_client` / `invalid_request` even though credentials look correct.
**Problem:** Sign-in on Android or web fails immediately, or Apple returns `invalid_client` / `invalid_request` even though credentials look correct.

**Cause:** There are two separate identifiers in Apple's system and they are easy to mix up:

Expand Down Expand Up @@ -173,7 +173,7 @@ If you use `--dart-define`, confirm `APPLE_SERVICE_IDENTIFIER` is the Services I

## Web sign-in fails with `TypeError: type ... is not a subtype of type 'JSObject'`

**Problem:** Clicking the Apple button on Web throws a `TypeError` mentioning `JSObject` or a minified type like `minified:CM`.
**Problem:** Clicking the Apple button on web throws a `TypeError` mentioning `JSObject` or a minified type like `minified:CM`.

**Cause:** The Apple JS SDK is not loaded. The `sign_in_with_apple` package calls `AppleID.auth.init()` on the page, but that function only exists after Apple's script is loaded in the HTML.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pod.initializeAuthServices(
);
```

The `FirebaseIdpConfigFromPasswords()` constructor automatically loads the service account key from the `firebaseServiceAccountKey` key in `config/passwords.yaml` (or the `SERVERPOD_PASSWORD_firebaseServiceAccountKey` environment variable). For loading credentials from other sources (file, JSON map, project ID only), see the [Customizations](./customizations) page.
The `FirebaseIdpConfigFromPasswords()` constructor automatically loads the service account key from the `firebaseServiceAccountKey` key in `config/passwords.yaml` (or the `SERVERPOD_PASSWORD_firebaseServiceAccountKey` environment variable). For loading credentials from other sources (file, JSON map, project ID only), see the [Configuration](./configuration) page.

### 2. Create the endpoint

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
sidebar_label: Customizations
sidebar_label: Configuration
description: Firebase identity provider credentials can be loaded from different sources with FirebaseIdpConfig. Configure the provider beyond the basic setup.
---

# Customize Firebase authentication
# Configure Firebase authentication

This page covers additional configuration options for the Firebase identity provider beyond the basic setup.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Go through this before investigating a specific error. Most problems come from a
#### Firebase Console

- [ ] Create a **Firebase project** in the [Firebase Console](https://console.firebase.google.com/).
- [ ] Add an app for **every platform you support** (iOS, Android, Web) inside the Firebase project. Each platform needs its own registration.
- [ ] Add an app for **every platform you support** (iOS, Android, web) inside the Firebase project. Each platform needs its own registration.
- [ ] Generate a **service account key** from **Project settings** > **Service accounts**.
- [ ] Enable the **authentication methods** you want to use under **Security** > **Authentication** > **Sign-in method**.
- [ ] Confirm **Firebase App Check** is **disabled** (enable it later only after the client integration is in place).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Go through this before investigating a specific error. Most problems come from a
- [ ] Both `clientId` and `redirectUri` match values registered on the GitHub App.
- [ ] On **Android**, added the `flutter_web_auth_2` `CallbackActivity` to `AndroidManifest.xml` with the **exact** scheme used in your callback URL.
- [ ] On **Web (Serverpod-hosted Flutter)**, registered `FlutterWebAuth2CallbackRoute` via `pod.webServer.addRoute(...)` in `server.dart` before `pod.start()`. On **Web (separately-hosted Flutter)**, created `web/auth.html` in your Flutter project. See [Web](./setup#web) for both flows.
- [ ] On **Web**, ran Flutter on a fixed `--web-port` matching the port registered in the GitHub App's callback URL.
- [ ] On **web**, ran Flutter on a fixed `--web-port` matching the port registered in the GitHub App's callback URL.

## Sign-in fails with redirect_uri_mismatch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ The tenant has no environment variable. Pass it as an argument when you initiali

This approach is useful when you need to:

- Manage separate client IDs for different platforms (Android, iOS, Web, macOS) in a centralized way
- Manage separate client IDs for different platforms (Android, iOS, web, macOS) in a centralized way
- Avoid committing client IDs to version control
- Configure different credentials for different build environments (development, staging, production)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Go through this before investigating a specific error. Most problems come from a
- [ ] The `tenant` passed on initialization matches the server's `tenant` setting. Both default to `common`.
- [ ] On **Android**, added the `flutter_web_auth_2` `CallbackActivity` to `AndroidManifest.xml` with the **exact** scheme and host used in your callback URL.
- [ ] On **Web**, created `web/auth.html` in your Flutter project with the callback script from [Web callback page (`auth.html`)](../../setup#web-callback-page-authhtml).
- [ ] On **Web**, ran Flutter on a fixed `--web-port` matching the port in the registered redirect URI.
- [ ] On **web**, ran Flutter on a fixed `--web-port` matching the port in the registered redirect URI.

## Sign-in fails with a redirect URI error

Expand Down
Loading
Loading