avniproject / avniproject/avni-server

Create a Generic `IdentityProvider` Class to Support Multiple Identity Providers

Open
#910 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
22
Forks
47
PR merge metrics
No merged PRs in 30d

Description

### Description:

We are currently using Amazon Cognito as the primary Identity Provider in our system. To make the system more flexible and extendable, we propose creating a generic `IdentityProvider` class. This will allow us to support multiple Identity Providers out of the box and give users the flexibility to integrate their own providers.

### Changes:

* **Introduce a generic `IdentityProvider` class** that defines a set of standard methods for interacting with different identity providers.
* **Add support for the following providers out of the box**:

* **[MeriPehchan](https://meripehchaan.gov.in)**
* **[EntraID](https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id)**
* **[Google Cloud Identity](https://cloud.google.com/identity)**
* **[Auth0](https://auth0.com/docs/authenticate/identity-providers)**
* **Allow users to bring in their own identity providers** by extending the `IdentityProvider` class.
* **Refactor the `AuthenticationHelper` class** to interact with the new `IdentityProvider` class.

### Benefits:

* **Extensibility**: The system will be able to integrate with additional identity providers as needed.
* **Flexibility**: Users will be able to define their own custom identity providers.
* **Maintainability**: A common abstraction for identity providers simplifies managing these integrations.

### Steps to Implement:

1. **Design the interface for the `IdentityProvider` class**.
2. **Implement out-of-the-box support** for MeriPehchan, EntraID, Google Cloud Identity, and Auth0.
3. **Refactor the `AuthenticationHelper` class** to use the new `IdentityProvider` interface.
4. **Document how to extend the system to support custom identity providers**.

### Impact:

This change will simplify the process of adding and switching identity providers and increase the flexibility of the authentication system.

**I am happy to submit a PR with these changes.**

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating AuthenticationHelper and the current Amazon Cognito integration, then trace how authentication providers are configured and called. Define the shared provider boundary before implementing MeriPehchan, EntraID, Google Cloud Identity, and Auth0 support; done means the helper uses the abstraction, custom providers can extend it, and the extension process is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
authentication, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.