Skip to main content

Implement Authentication with Firebase

Firebase is an authentication tool that supports various sign-in methods, including social logins and email/password combinations. Nautical supports a Firebase plugin, enabling you to provide a seamless login option for users in your marketplace. This plugin leverages Firebase's secure user token to authenticate and authorize users within Nautical.

Connecting Nautical to Firebase

Before you can implement Firebase as your authentication provider in your marketplace, you must activate the Firebase plugin.

Before you start:

  • Sign up for a Firebase account
  • Configure which sign-in methods you will support

Step 1: Retrieve the Firebase private key

  1. From Firebase Console, select the Gear menu and go to Project Settings -> Service accounts.

  1. On the Service accounts page, select Generate new private key.

  1. Open the private key JSON file and copy the contents. The JSON file will look similar to the following:
Private key JSON file
{
"type": "service_account",
"project_id": "nautical-testing",
"private_key_id": "1abcdefg23hijkl456mno7890pqrxtuv14942",
"private_key": "-----BEGIN PRIVATE KEY-----\MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD\n-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-7ek9g@nautical-testing.iam.gserviceaccount.com",
"client_id": "103289515217672741907",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-7ek9g%40nautical-testing.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}

Step 2: Activate the Nautical integration

  1. In the Nautical dashboard, go to Settings -> Apps.
  2. Open the Firebase app.
  3. In the Service Account credentials (JSON string) field, paste the entire contents of the Firebase private key JSON file.

  1. Select Save.
  2. Select Activate.
caution

Make sure to delete the private key JSON file from your machine once you have finished using it.

Learn more

Implement Firebase authentication via Nautical's GraphQL API

Was this page helpful?