Skip to content
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

Feature: Add multi provider Authentication #318

Merged

Conversation

syphax-bouazzouni
Copy link
Collaborator

Prerequisites

Context

See ontoportal/ontoportal-project#26. and lifewatch-eric/ontologies_linked_data#5

This PR adds login using external authentication providers Github, Google, Orcid, and Keycloak. It was implemented using the omni_auth gem that standardizes multi-provider authentication for web applications.

image

The general workflow is so

image
  1. Redirect the user to the external provider to connect.
  2. The external provider returns a token authenticating the user.
  3. The UI sends the token and the provider name (e.g. Github) to the API.
  4. The API test that the token is valid by two possible ways, by trying to decode the token using a secret key or by calling again the external provider.
  5. If the token is valid the external provider returns the user information (name, email, ....)
  6. With the email we check if we find an existent user with the same email otherwise we create a new one with the date received.
  7. If connected using Github or ORCID, we synchronize the user githhubId and orcidId attributes.

Changes

  • Install and configure omniauth gems (c3be314)
  • Add a helper to get omniauth_providers details (70cb7ce)
  • Add external auth providers icons on the login in page (fa9f56d)
  • Add OAuth login action (69a17c7)
  • Add omniauth_token_provider helper (5a8f1a2)

@syphax-bouazzouni syphax-bouazzouni added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 6, 2023
@syphax-bouazzouni syphax-bouazzouni self-assigned this Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant