Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
8 changes: 3 additions & 5 deletions docs/06-concepts/10-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,16 @@ modules:
nickname: auth
```

Then run `pub get` and `serverpod generate` from your server's directory (e.g., `mypod_server`) to add the module to your project's deserializer.
Then run `pub get` from your server's directory (e.g., `mypod_server`):

```bash
$ dart pub get
$ serverpod generate
```

Finally, since modules might include modifications to the database schema, you should create a new database migration and apply it by running `serverpod create-migration` then `dart bin/main.dart --apply-migrations` from your server's directory.
Start the server to wire up the module and apply any database changes it brings:

```bash
$ serverpod create-migration
$ dart bin/main.dart --apply-migrations
$ serverpod start
```

### Client setup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,12 @@ import 'package:serverpod_auth_idp_server/providers/google.dart';
class GoogleIdpEndpoint extends GoogleIdpBaseEndpoint {}
```

### Generate code and apply migrations
### Start the server

Run the following commands from your server project directory (e.g., `my_project_server/`) to generate client code and apply the database migration:
Start the server from your server project directory (e.g., `my_project_server/`):

```bash
serverpod generate
serverpod create-migration
dart run bin/main.dart --apply-migrations
serverpod start
```

:::warning
Expand Down Expand Up @@ -244,7 +242,7 @@ On web, Google completes sign-in by redirecting the browser to a callback URL yo

```bash
flutter build web --output ../my_project_server/web/app # from your Flutter project
dart run bin/main.dart # from your server project
serverpod start # from your server project
```

Open `http://localhost:8082/app` to test. `flutter run -d chrome` won't work here because Flutter's dev server runs on a different port from Serverpod — for hot-reload workflows, use the [separately-hosted Flutter web](./customizations#separately-hosted-flutter-web) flow instead.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Go through this before investigating a specific error. Most problems come from a
- [ ] For new or customized servers, confirm auth services and JWT are configured per [Authentication setup](../../setup#identity-providers-configuration) before adding Google.
- [ ] Add `GoogleIdpConfigFromPasswords()` to `identityProviderBuilders` in `server.dart`.
- [ ] Create a `GoogleIdpEndpoint` file in `lib/src/auth/`.
- [ ] Run `serverpod generate`, then `serverpod create-migration`, then apply migrations using `--apply-migrations`.
- [ ] Started the server with `serverpod start`.
Comment thread
Zfinix marked this conversation as resolved.
Outdated

#### Client

Expand Down Expand Up @@ -172,9 +172,7 @@ Every line of the JSON must be indented by at least one level more than `googleC
**Resolution:** Create and apply the migration:

```bash
serverpod generate
serverpod create-migration
dart run bin/main.dart --apply-migrations
serverpod start
```

## Lightweight sign-in (One Tap) not appearing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,12 @@ import 'package:serverpod_auth_idp_server/providers/apple.dart';
class AppleIdpEndpoint extends AppleIdpBaseEndpoint {}
```

### Generate code and apply migrations
### Start the server

Run the following commands from your server project directory (e.g., `my_project_server/`) to generate client code and apply the database migration:
Start the server from your server project directory (e.g., `my_project_server/`):

```bash
serverpod generate
serverpod create-migration
dart run bin/main.dart --apply-migrations
serverpod start
```

:::note
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Go through this before investigating a specific error. Most problems come from a
* [ ] Add `AppleIdpConfigFromPasswords()` to `identityProviderBuilders` in `server.dart`.
* [ ] Call **`pod.configureAppleIdpRoutes(...)`** on the server before the pod starts.
* [ ] Create an `AppleIdpEndpoint` file in `lib/src/auth/`.
* [ ] Run **`serverpod generate`**, then apply migrations using `--apply-migrations`.
* [ ] Started the server with `serverpod start`.
Comment thread
Zfinix marked this conversation as resolved.
Outdated

#### Client

Expand Down Expand Up @@ -124,9 +124,7 @@ If you use `--dart-define`, confirm `APPLE_SERVICE_IDENTIFIER` is the Services I
**Resolution:** Create and apply the migration:

```bash
serverpod generate
serverpod create-migration
dart run bin/main.dart --apply-migrations
serverpod start
```

## Apple rejects the redirect URI with `invalid_request`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,12 @@ import 'package:serverpod_auth_idp_server/providers/firebase.dart';
class FirebaseIdpEndpoint extends FirebaseIdpBaseEndpoint {}
```

### 3. Generate code and apply migrations
### 3. Start the server

Run the following commands from your server project directory (e.g., `my_project_server/`) to generate client code and apply the database migration:
Start the server from your server project directory (e.g., `my_project_server/`):

```bash
serverpod generate
serverpod create-migration
dart run bin/main.dart --apply-migrations
serverpod start
```

:::note
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Go through this before investigating a specific error. Most problems come from a
- [ ] Confirm the `project_id` inside `firebaseServiceAccountKey` matches the Firebase project the client is using.
- [ ] Add `FirebaseIdpConfigFromPasswords()` to `identityProviderBuilders` in `server.dart`.
- [ ] Create a `FirebaseIdpEndpoint` file in `lib/src/auth/` extending `FirebaseIdpBaseEndpoint`.
- [ ] Run **`serverpod generate`**, then **`serverpod create-migration`**, then apply migrations with `dart run bin/main.dart --apply-migrations`.
- [ ] Run **`serverpod generate`**, then **`serverpod create-migration`**, then start the server with `serverpod start`.
Comment thread
Zfinix marked this conversation as resolved.
Outdated

#### Client

Expand All @@ -41,9 +41,7 @@ Go through this before investigating a specific error. Most problems come from a
**Resolution:** Create and apply the migration:

```bash
serverpod generate
serverpod create-migration
dart run bin/main.dart --apply-migrations
serverpod start
```

## Token verification fails with "invalid signature"
Expand Down Expand Up @@ -109,7 +107,7 @@ If you haven't run `flutterfire configure`, do so to generate the `firebase_opti

1. **Missing service account key:** The `firebaseServiceAccountKey` is not present in `passwords.yaml`, or the JSON is invalid.
2. **Missing endpoint:** You did not create the endpoint class extending `FirebaseIdpBaseEndpoint`. Without it, the client has no endpoint to call.
3. **Missing migration:** The provider's database tables don't exist yet. Apply migrations with `dart run bin/main.dart --apply-migrations`.
3. **Missing migration:** The provider's database tables don't exist yet. Start the server with `serverpod start`.
4. **Project mismatch:** The service account key belongs to a different Firebase project than the one configured in your Flutter app. Compare `project_id` in `firebaseServiceAccountKey` against the project in `firebase_options.dart`.
5. **App Check enabled prematurely:** If you enabled Firebase App Check before the client integration is in place, every request will be rejected with an App Check assertion error. Disable App Check until the client is wired up.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,12 @@ import 'package:serverpod_auth_idp_server/providers/github.dart';
class GitHubIdpEndpoint extends GitHubIdpBaseEndpoint {}
```

### Generate code and apply migrations
### Start the server

Run the following commands from your server project directory (e.g., `my_project_server/`) to generate client code and apply the database migration:
Start the server from your server project directory (e.g., `my_project_server/`):

```bash
serverpod generate
serverpod create-migration
dart run bin/main.dart --apply-migrations
serverpod start
```

:::warning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Go through this before investigating a specific error. Most problems come from a
- [ ] Added `githubClientId` and `githubClientSecret` to `config/passwords.yaml` under the matching environment (`development:` for local, `production:` for prod), or set the matching `SERVERPOD_PASSWORD_githubClientId` and `SERVERPOD_PASSWORD_githubClientSecret` environment variables.
- [ ] Added `GitHubIdpConfigFromPasswords()` to `identityProviderBuilders` in `server.dart`.
- [ ] Created a `GitHubIdpEndpoint` file in `lib/src/auth/`.
- [ ] Ran `serverpod generate`, then `serverpod create-migration`, then applied migrations with `--apply-migrations`.
- [ ] Started the server with `serverpod start`.

#### Client

Expand Down Expand Up @@ -161,7 +161,7 @@ See [Configuring client IDs on the app](./customizations#configuring-client-ids-

**Cause:** The keys are missing from `config/passwords.yaml`, are spelled differently, or are not present under the active environment section.

**Resolution:** Confirm both keys exist under the section matching your run mode (`development:` for `dart run bin/main.dart`, `production:` when deployed):
**Resolution:** Confirm both keys exist under the section matching your run mode (`development:` when running locally with `serverpod start`, `production:` when deployed):

```yaml
development:
Expand All @@ -180,9 +180,7 @@ Quotes are required because the values are strings; YAML interprets unquoted val
**Resolution:** Create and apply the migration:

```bash
serverpod generate
serverpod create-migration
dart run bin/main.dart --apply-migrations
serverpod start
```

## Android sign-in opens GitHub but the callback never fires
Expand Down
Loading