
Google Cloud Identity Platform is Google's managed CIAM service for web and mobile applications. It provides user account management, customizable authentication flows, social and enterprise identity federation, multi-factor authentication, and integration with Google Cloud services. It removes the need to operate an identity store, but it bills per monthly active user (MAU) in provider tiers, where email, phone, anonymous, and social sign-in are free to 50,000 MAU while OIDC and SAML federation are free only to 50 MAU before per-user charges begin, meters phone and multi-factor messages separately, and ties the user store and its flows to a Google Cloud project.
Logto is an open-source Customer Identity and Access Management (CIAM) platform built on the OAuth 2.1 and OpenID Connect (OIDC) standards, and it covers the same ground on self-hosted infrastructure without per-user billing or cloud provider API dependencies. It provides a branded sign-in experience, social and enterprise Single Sign-On (SSO) federation, multi-factor authentication (MFA), role-based access control (RBAC), organizations for multi-tenancy, and webhooks, and it stores every user, application, and role in a PostgreSQL database you control. Because it implements the OIDC specification rather than a proprietary protocol, standard client libraries integrate with it unchanged. A self-hosted deployment also gives you direct control over the token lifetimes, the user schema, the connector set, and the data residency of the identity store.
This article explains how to deploy Logto as an alternative to Google Cloud Identity Platform. It covers the Docker Compose deployment with Traefik as the reverse proxy, automatic HTTPS with Let's Encrypt, the admin console, the sign-in experience and brand identity, email and social login connectors, enterprise SSO, MFA, RBAC and API resources, organizations for multi-tenancy, application registration, webhooks, deployment verification, and migration from Google Cloud Identity Platform.
Logto covers most Identity Platform components through a self-hosted, OIDC-standard platform. The following table maps each Identity Platform feature to its Logto counterpart and notes where no equivalent exists.
The Logto Core service (auth.example.com) exposes the OIDC endpoints, Management API (/api), and the user-facing sign-in experience. The Admin Console (admin.example.com) is a separate frontend that manages tenant configuration through the Management API.
Before you begin:
auth.example.com (Logto Core API and sign-in experience) and admin.example.com (Admin Console).Logto requires PostgreSQL 14 or later to store users, configuration, and session data. This section deploys Logto for production on a Linux server using Docker Compose, Traefik for automatic HTTPS with Let's Encrypt, and PostgreSQL for durable storage.
Create the project directory structure.
Navigate to the project directory.
Create the Logto environment file.
Add the following configuration:
Save and close the file.
Replace:
auth.example.com: Your Logto Core API subdomain.admin.example.com: Your Admin Console subdomain.admin@example.com: Your email address for Let's Encrypt certificate notifications.DB-PASSWORD: A strong password for the PostgreSQL database.1.40.1: The Logto release version to deploy. Check the Logto releases page for the latest stable version when upgrading.Download the Logto Docker Compose file for the pinned release.
Pin the compose file URL to the same release tag as TAG in the environment file. The following docker-compose.yml file is maintained by Logto.
Update the docker-compose.yml file for production use. The official compose file ships with hardcoded database credentials and is labeled for demonstration; replace those defaults before deployment.
Find the app service and update the DB_URL under the environment section as follows:
Find the postgres service and update the POSTGRES_PASSWORD value in the environment section:
Pin the PostgreSQL image to a specific release for reproducible deployments:
Save and close the file.
Create the Traefik Docker Compose override file.
Add the following configuration:
Save and close the file.
Traefik routes HTTPS traffic to Logto on subdomain-based host rules. Port 3001 serves the Core API and sign-in experience; port 3002 serves the Admin Console. Let's Encrypt certificates are provisioned automatically once DNS resolves to this server. This stack pins svhd/logto to the TAG value in .env, traefik to v3.7.0, and PostgreSQL to 17.5-alpine for reproducible production deployments.
Start the Logto stack.
Verify the containers are running.
The output displays running containers for Traefik, Logto, and PostgreSQL.
Verify HTTPS on the Admin Console.
The output returns HTTP/2 302 with location: /console/welcome on first boot.
Verify the OIDC discovery endpoint.
The output returns JSON containing authorization_endpoint and issuer values scoped to your auth.example.com domain.
The Admin Console is the central management interface for configuring the Logto tenant.
https://admin.example.com.The sign-in experience defines the look, feel, and authentication flow for your users. Logto allows you to customize the interface to match your brand identity.
https://example.com/logo.png) and set the primary brand color (for example, #6139F6).To verify user identities via email and enable password resets, configure an email connector with your SMTP provider credentials.
SMTP-HOSTSMTP-PORTloginSMTP-USERNAMESMTP-PASSWORDSENDER-EMAIL-ADDRESSREPLY-TO-EMAIL-ADDRESSSelect the primary methods users can use to create an account and sign in. Logto supports username, email, and phone-based authentication.
Passwordless authentication reduces friction by allowing users to sign in with one-time codes instead of a password.
While this article focuses on email via SMTP, Logto also supports SMS-based registration and sign-in via third-party providers such as Twilio or Vonage. To use phone numbers, configure an SMS connector under Connectors by selecting the Email and SMS connectors tab. Users access the hosted sign-in UI through a registered application with a valid client_id and redirect URI, not by visiting auth.example.com directly. Direct navigation without an application context returns an unknown-session page.
Social login allows users to authenticate using their existing accounts from third-party identity providers, reducing friction during the registration process.
example.com) as an authorized domain.https://auth.example.com/callback/google) to the Authorized redirect URIs.openid, profile, and email. If the application requires additional Google API access (such as Calendar or Drive), append the respective scope URLs separated by spaces.Enterprise Single Sign-On (SSO) enables corporate users to authenticate via their own Identity Provider (IdP), such as Okta or Microsoft Entra ID.
example.com).Users with matching email domains are automatically routed to the enterprise IdP login page. Other sign-in methods like social login or local passwords are disabled for these domains to enforce corporate security policies.
Multi-factor Authentication (MFA) adds an extra layer of security by requiring secondary verification during the sign-in process.
Role-Based Access Control (RBAC) securely limits access to specific backend resources and endpoints based on a user's assigned role.
https://api.example.com/orders).read:orders and write:orders.Organizations offer multi-tenant isolation, allowing you to build B2B applications where users belong to different corporate entities. An organization template serves as a blueprint, defining a consistent set of roles and permissions available to every organization in your Logto tenant.
read:resource) and Description.edit:resource and delete:resource.Admin or Member) and a description.Register your frontend and backend services as applications within Logto to authenticate users and obtain tokens.
Specific steps vary depending on the application type, such as Single-Page App, Traditional Web App, Native App, or Machine-to-Machine. Use the framework-specific tutorial provided in the console for detailed instructions.
Register at least three application types to cover common architectures:
Open the application sign-in URL or use the Logto SDK in a test client to confirm the redirect-based sign-in flow completes successfully.
Webhooks offer real-time notifications for identity events, allowing your backend systems to react asynchronously to changes within Logto without continuous polling.
User.Created, PostSignIn, or User.Data.Updated).After configuration, run the following checks to confirm the deployment is healthy end to end.
docker ps. Traefik, Logto, and PostgreSQL should report an Up status.https://admin.example.com and https://auth.example.com in a browser. Both should load with valid Let's Encrypt certificates.curl -s https://auth.example.com/oidc/.well-known/openid-configuration and confirm the issuer matches https://auth.example.com/oidc.Migrating from GCP Identity Platform to Logto involves mapping Identity Platform Users and Tenants to Logto Organizations and Users, replacing Firebase / GCP Admin SDK calls with Logto SDKs and the Management API, and converting Blocking Functions to webhooks or Custom JWT scripts. Because Identity Platform does not export password hashes or MFA secrets, most migrations follow a bulk user import with mandatory re-authentication strategy. The guidance below assumes you completed Deploy Logto with Docker Compose, Access the Admin Console, and Register Applications earlier in this article.
GCP Identity Platform bundles user directories, authentication flows, OAuth client configurations, and tenant isolation into a single managed service. Logto splits these responsibilities across users, the sign-in experience, applications, roles, and organizations within a self-hosted tenant.
listUsers()) or the Identity Toolkit API. For multi-tenant projects, iterate through each tenant to export tenant-scoped users.POST /api/users at https://auth.example.com/api). Authenticate with an access token from a Logto Machine-to-Machine application.localId (UID) in Logto customData (for example, legacy_firebase_uid) during import to preserve linkages in downstream application databases and Cloud Firestore documents.Application changes depend on how clients currently integrate with Identity Platform.
If applications use the Firebase Authentication SDK, replace Firebase Auth APIs with the Logto SDK for your framework:
signInWithEmailAndPassword / signInWithPopup / embedded forms: Redirect-based Universal Login through the Logto hosted sign-in experience.client_id in OIDC).If applications call the Identity Platform API directly via the Identity Toolkit REST API or the Firebase Admin SDK, replace those calls with Logto SDK methods or direct OIDC endpoints:
verifyPassword / verifyCustomToken / signUp: OIDC authorization code flow with PKCE (browser apps) or client credentials flow (M2M).https://auth.example.com/oidc/jwks) with issuer https://auth.example.com/oidc.In both cases, update backend middleware to validate Logto-issued JWTs instead of Firebase ID tokens. Refer to the Logto protect-your-api documentation for framework-specific examples.
Identity Platform does not provide a native group primitive. Instead, developers typically assign roles through custom claims (via the Firebase Admin SDK setCustomUserClaims) or isolate users by tenant. Logto offers two mapping paths depending on whether your existing structure represents global permissions or tenant-scoped membership.
POST /api/roles), define API resource permissions, and assign users (POST /api/users/{userId}/roles). Global roles are not included in access tokens by default; configure a Custom JWT access token script in the Admin Console to inject role claims.POST /api/organizations), define organization roles in the Organization template, and add members (POST /api/organizations/{id}/users). If you previously stored tenant membership in Firestore or custom claims, import that relational data into Logto organization memberships.decodedToken.admin or decodedToken.tenant_id with Logto roles or organization_roles claims).Identity Platform's Blocking Functions and Asynchronous Functions run during the authentication lifecycle. Logto does not support synchronous blocking hooks; each trigger type maps to a different replacement with distinct operational characteristics.
User.Created, PostSignIn, or User.Data.Updated. Webhooks deliver HTTP payloads asynchronously after the auth flow completes. Refer to the Logto webhook documentation.setCustomUserClaims) or within blocking functions to embed roles and permissions into Firebase ID tokens. Logto scripts run in a sandbox during token issuance to inject roles, organization memberships, or custom attributes into the JWT.Unlike Cloud Functions, which scale per invocation and run only during auth events, Custom JWT scripts execute on every token issuance and webhook consumers run as always-on services. Account for this operational difference when planning capacity.
For environments with existing identity data and active sessions:
onAuthStateChanged listeners will fire with null).localId values in their own databases rely on the legacy_identity_platform_uid mapping in Logto customData until those references are updated.getUser, listUsers, updateUser) with the Logto Management API at https://auth.example.com/api. Authenticate M2M clients with a Logto Machine-to-Machine application.signInWithEmailAndPassword, signInWithPopup) and direct Identity Toolkit API calls must move to redirect-based OIDC flows. This is the largest application-code change in most migrations.firebase claim (sign_in_provider, tenant) alongside any custom claims. Logto issues standard OIDC claims (sub, email, scope, organization_id). Update API parsers and authorization middleware accordingly.You have deployed Logto behind a Traefik reverse proxy, configured the sign-in experience, social and enterprise SSO, MFA, RBAC, organizations, applications, and webhooks, and verified the deployment end to end. The migration section also covers the key steps and considerations for migrating users, applications, and authentication flows from Google Cloud Identity Platform to Logto. For additional deployment options, advanced configuration, and SDK integrations, refer to the official Logto documentation.
0 Comments
Be the first to comment and share your perspective with the community.