• Blog
  • Documentation
  • Courses
  • Changelog
  • AI Starters
  • UI Kit
  • FAQ
  • Supamode
    New
  • Pricing

Launch your next SaaS in record time with Makerkit, a React SaaS Boilerplate for Next.js and Supabase.

Makerkit is a product of Makerkit Pte Ltd (registered in the Republic of Singapore)Company Registration No: 202407149CFor support or inquiries, please contact us

About
  • FAQ
  • Contact
  • Verify your Discord
  • Consultation
  • Open Source
  • Become an Affiliate
Product
  • Documentation
  • Blog
  • Changelog
  • UI Blocks
  • Figma UI Kit
  • AI SaaS Starters
License
  • Activate License
  • Upgrade License
  • Invite Member
Legal
  • Terms of License
  • Auth Overview
  • Global Configuration
    • Setting up your Firebase Project
    • Setting up Firebase Functions
  • Writing data to Firestore
  • Commands
  • Introduction
  • Production Checklist
  • Introduction
  • Overview
  • Stripe Configuration
  • Running Tests
  • Introduction
  • Setting up Firebase Auth
  • Fetching data from Firestore
  • Technical Details
  • Extending Organizations
  • Stripe Webhooks
  • CI Tests
  • Initial Setup
  • React Hooks
  • Auth Flow
  • API requests
  • Code Style
  • Clone the repository
  • Security Rules
  • User Permissions
  • Limitations
  • Project Structure
  • Third-Party Providers
  • Reading data from Storage
  • Running the application
  • Subscription Permissions
  • One-Time Payments
  • Running the App
  • Email Link Authentication
  • Uploading data to Storage
  • Security Rules
  • Migrate to Lemon Squeezy
  • Project Configuration
  • Multi-Factor Authentication
  • Writing your own Fetch
  • Translations and Locales
  • Coding Conventions
  • Environment Variables
  • Architecture and Folder Structure
    • Structure your Application
    • Data Model
  • Requiring Email verification
  • Sending Emails
  • Tailwind CSS and Styling
  • Validating API payload with Zod
  • Authentication
  • Onboarding Flow
  • Logging
  • Development: adding custom features
  • Prevent abuse with AppCheck
  • Enable CORS
  • Encrypting Secrets
  • User Roles
  • Firestore: Data Fetching
  • Custom React Hooks
  • Custom React Hooks
  • Firestore: Data Writing
  • Troubleshooting
  • Forms
  • Application Pages
  • API Routes
  • API Routes Validation
  • Translations
  • Adding pages to the Marketing Site
  • Deploying to Production
  • Updating to the latest version
This kit is no longer maintained.

Set up Third party authentication providers with Remix and Firebase

Learn how to setup Third-Party oAuth providers with Firebase Auth in your Remix MakerKit application

By default, the kit uses Google as the third-party provider to allow users to access the application.

With that said, you could decide to add other providers that Firebase provides or even custom ones.

Customizing the Third Party providers

To add one or multiple oAuth providers, we will need to customize the global configuration by adding the Firebase provider to the oAuth array.

For example, we could also add Facebook, Twitter, and GitHub:

configuration.ts
import { FacebookAuthProvider, TwitterAuthProvider, GitHubAuthProvider } from
'firebase/auth';
{
auth: {
providers: {
oAuth: [
GoogleAuthProvider,
FacebookAuthProvider,
TwitterAuthProvider,
GitHubAuthProvider
],
}
}
}

Additionally, we can add custom oAuth providers. First, we define them by extending the OAuthProvider class:

tsx
class MicrosoftAuthProvider extends OAuthProvider {
constructor() {
super('microsoft.com');
}
}
class AppleAuthProvider extends OAuthProvider {
constructor() {
super('apple.com');
}
}

And then, we simply add them to the oAuth array:

tsx
oAuth: [
GoogleAuthProvider,
MicrosoftAuthProvider,
AppleAuthProvider
],

<p> Remember that you will always need to enable the authentication methods you want to use from the Firebase Console once you deploy your application to production. </p>

<p> Often, these need an additional configuration you need to enable on the provider's end. </p>

Adding Additional Scopes

To add additional scopes to the oAuth provider, we can tweak the OAuthProviders.tsx component and assign the scopes based on the instance type:

OAuthProviders.tsx
import {
GoogleAuthProvider,
FacebookAuthProvider,
} from 'firebase/auth';
{OAUTH_PROVIDERS.map((OAuthProviderClass) => {
const providerInstance = new OAuthProviderClass();
const providerId = providerInstance.providerId;
if (providerInstance instanceof GoogleAuthProvider) {
providerInstance.addScope('scope');
}
if (providerInstance instanceof FacebookAuthProvider) {
providerInstance.addScope('scope');
}
return (
// render <AuthProviderButton />
);
});

For example, if you are adding the scopes for Facebook Login, you can check out the Firebase documentation. Then, add them to the addScope method as described above.

On this page
  1. Customizing the Third Party providers
    1. Adding Additional Scopes