@@ -141,13 +141,81 @@ required to ensure that exported user records contain the password hashes of the
141
141
Also obtain the web API key of the project from the "Settings > General" page, and save it as
142
142
` integration_apikey.txt ` at the root of the codebase.
143
143
144
- Some of the integration tests require an
145
- [ Identity Platform] ( https://cloud.google.com/identity-platform/ ) project with multi-tenancy
146
- [ enabled] ( https://cloud.google.com/identity-platform/docs/multi-tenancy-quickstart#enabling_multi-tenancy ) .
147
- An existing Firebase project can be upgraded to an Identity Platform project without losing any
148
- functionality via the
149
- [ Identity Platform Marketplace Page] ( https://console.cloud.google.com/customer-identity ) . Note that
150
- charges may be incurred for active users beyond the Identity Platform free tier.
144
+
145
+ If you do not already have one suitable for running the tests against, you can create a new
146
+ project in the
147
+ [ Firebase Console] ( https://console.firebase.google.com ) following the setup guide below.
148
+ Otherwise you can obtain the following credentials from your current project:
149
+
150
+
151
+ 1 . Service account certificate: This can be downloaded as a JSON file from the
152
+ ** 'Settings > Service Accounts'** tab of the Firebase console when you click the
153
+ ** 'Generate new private key'** button. Copy the file into the repo so it's available at
154
+ ` integration_cert.json ` .
155
+
156
+
157
+ 2 . Web API key: This is displayed in the ** 'Settings > General'** tab of the Firebase console
158
+ after enabling Authentication as described in the steps below. Copy it and save to a new text
159
+ file at ` integration_apikey.txt ` .
160
+
161
+
162
+ Set up your Firebase project as follows:
163
+
164
+
165
+ 1 . Enable Authentication:
166
+ 1 . Go to the Firebase Console, and select ** 'Authentication'** from the ** 'Build'** menu.
167
+ 2 . Click on ** 'Get Started'** .
168
+ 3 . Select ** 'Sign-in method > Add new provider > Email/Password'** then enable both the
169
+ ** 'Email/Password'** and ** 'Email link (passwordless sign-in)'** options.
170
+
171
+
172
+ 2 . Enable Firestore:
173
+ 1 . Go to the Firebase Console, and select ** 'Firestore Database'** from the ** 'Build'** menu.
174
+ 2 . Click on the ** 'Create database'** button. You can choose to set up Firestore either in
175
+ the production mode or in the test mode.
176
+
177
+
178
+ 3 . Enable Realtime Database:
179
+ 1 . Go to the Firebase Console, and select ** 'Realtime Database'** from the ** 'Build'** menu.
180
+ 2 . Click on the ** 'Create database'** button. You can choose to set up the Realtime database
181
+ either in the locked mode or in the test mode.
182
+ 3 . In the ** 'Data'** tab click on the kebab menu (3 dots) and select ** 'Create Database'** .
183
+ 4 . Enter your Project ID (Found in the ** 'General'** tab in ** 'Account Settings'** ) as the
184
+ ** 'Realtime Database reference'** . Again, you can choose to set up the Realtime database
185
+ either in the locked mode or in the test mode.
186
+
187
+
188
+ 4 . Enable Storage:
189
+ 1 . Go to the Firebase Console, and select ** 'Storage'** from the ** 'Build'** menu.
190
+ 2 . Click on the ** 'Get started'** button. You can choose to set up the Realtime database
191
+ either in the production mode or in the test mode.
192
+
193
+
194
+ 5 . Enable the IAM API:
195
+ 1 . Go to the[ Google Cloud Platform Console] ( https://console.cloud.google.com )
196
+ and make sureyour Firebase project is selected.
197
+ 2 . Select ** 'APIs & Services'** from the main menu, and click the
198
+ ** 'ENABLE APIS AND SERVICES'** button.
199
+ 3 . Search for and enable ** 'Identity and Access Management (IAM) API'** by Google Enterprise API.
200
+
201
+
202
+ 6 . Enable Tenant Management:
203
+ 1 . Go to
204
+ [ Google Developers Console | Identity Platform] ( https://console.cloud.google.com/customer-identity/ )
205
+ and if it is not already enabled, click ** 'Enable'** .
206
+ 2 . Then follow
207
+ [ this guide] ( https://cloud.google.com/identity-platform/docs/multi-tenancy-quickstart#enabling_multi-tenancy )
208
+ to enable multi-tenancy.
209
+
210
+
211
+ 7 . Ensure your service account has the ** 'Firebase Authentication Admin'** role. This is required
212
+ to ensure that exported user records contain the password hashes of the user accounts:
213
+ 1 . Go to [ Google Cloud Platform Console / IAM & admin] ( https://console.cloud.google.com/iam-admin ) .
214
+ 2 . Find your service account in the list. If not added click the ** 'pencil'** icon to edit its
215
+ permissions.
216
+ 3 . Click ** 'ADD ANOTHER ROLE'** and choose ** 'Firebase Authentication Admin'** .
217
+ 4 . Click ** 'SAVE'** .
218
+
151
219
152
220
Now run the following command to invoke the integration test suite:
153
221
0 commit comments