Skip to content

Implement user-specific OAuth client instances #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

ojmarte
Copy link

@ojmarte ojmarte commented Dec 28, 2023

Problem

In our current implementation, the OAuth client is globally instantiated, leading to a limitation where it cannot handle multiple users concurrently in a secure and isolated manner. This setup restricts the application's ability to provide personalized experiences and poses a security risk, as the authentication state is not user-specific.

Solution

To address this, we have implemented a system where each user in our application gets a unique instance of the OAuth client. This change involves:

  1. User-Specific Credential Storage: Securely storing client_id and client_secret in our database, linked to individual user accounts.
  2. Dynamic OAuth Client Creation: Modifying the API routes to dynamically create an OAuth client instance using the stored credentials for each user request. This ensures that each authentication flow is unique and isolated to the user.
  3. Session Management Enhancements: Improving session management to maintain user identity across the OAuth flow, enabling a secure and seamless authentication process.

Result

With these changes, our application now supports a multi-user environment with enhanced security and personalization. Each user's authentication process is independently managed, allowing for a scalable and user-focused experience. This update lays the groundwork for future features that require user-specific settings and permissions, further advancing our application's capabilities.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ojmarte ojmarte closed this Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants