I am working on a web application where users log in using Firebase authentication. After logging in, I want users to grant access to their Gmail, Outlook, and Slack accounts to allow my app to read their emails and Slack messages.
Here’s what I have tried so far:
I used Auth.js to handle OAuth 2.0 for Gmail and Outlook, and it worked successfully for generating access tokens. However, I encountered an issue where only the most recent token is saved, and I couldn’t store multiple tokens for different providers (e.g., Gmail and Outlook). I am looking for advice on how to correctly implement the OAuth 2.0 process in this scenario. Specifically:
What is the most common approach for implementing OAuth 2.0 in a Firebase-authenticated app that requires multiple tokens (e.g., for Gmail, Outlook, and Slack)? How can I handle token storage to ensure that all granted access tokens are stored securely and can be used later? Are there any best practices or libraries that you recommend for handling OAuth 2.0 across multiple providers in a single application? I am relatively new to OAuth 2.0 and would appreciate any guidance or advice on how to approach this. Thank you! :)