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

Fix: Login with email and add option to disable some external auth provider #396

Merged
merged 11 commits into from
Dec 7, 2023

Conversation

Bilelkihal
Copy link
Collaborator

@Bilelkihal Bilelkihal commented Dec 5, 2023

Done in this PR:

  • Fix login using email (it was not working before)
    Before there was only login using username, what I'm doing is to check if the input is an email, if yes I get the username of the user based on the email and then do the login using the username.

  • Make orcid and Keycloak sso diasbled in login page
    To show that they work but not configured, I achieved that by adding a new key to the config file which is enable, and the new $OMNIAUTH_PROVIDERS is:

$OMNIAUTH_PROVIDERS = {
  github: {
    client_id: 'CLIENT_ID',
    client_secret: 'CLIENT_SECRET',
    icon: 'github.svg',
    enable: true
  },
  google: {
    strategy: :google_oauth2,
    client_id: 'CLIENT_ID',
    client_secret: 'CLIENT_SECRET',
    icon: 'google.svg',
    enable: true
  },
  orcid: {
    client_id: 'CLIENT_SECRET',
    client_secret: 'CLIENT_SECRET',
    icon: 'orcid.svg',
    enable: false
  },
  keycloak: {
    strategy: :keycloak_openid,
    client_id: 'YOUR_KEYCLOAK_CLIENT_ID',
    client_secret: 'YOUR_KEYCLOAK_CLIENT_SECRET',
    client_options: { site: 'KEYCLOAK_SITE', realm: 'KEYCLOAK_REALM' },
    name: 'keycloak',
    icon: 'keycloak.svg',
    enable: false
  }
}.freeze 

image

@Bilelkihal Bilelkihal added the bug Something isn't working label Dec 5, 2023
@Bilelkihal Bilelkihal self-assigned this Dec 5, 2023
@syphax-bouazzouni
Copy link
Collaborator

when we hover over the button, the disabled ones, need to show a tooltip to tell that they are disabled, using the tooltip component,see example https://stageportal.lirmm.fr/lookbook/inspect/display/info_tooltip/default

app/controllers/login_controller.rb Outdated Show resolved Hide resolved
app/views/login/index.html.haml Outdated Show resolved Hide resolved
Copy link
Collaborator Author

@Bilelkihal Bilelkihal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@syphax-bouazzouni
Copy link
Collaborator

seems the test don't pass, you need to update the .sample file with your changes in configuration

@syphax-bouazzouni
Copy link
Collaborator

You will need to update the config here https://github.com/ontoportal-lirmm/ontoportal-configs also @Bilelkihal

@Bilelkihal
Copy link
Collaborator Author

@syphax-bouazzouni
I need access
image

@syphax-bouazzouni syphax-bouazzouni changed the title Fix: Login issues Fix: Login with email and add option to disable some external auth provider Dec 7, 2023
@syphax-bouazzouni syphax-bouazzouni merged commit 61927a4 into development Dec 7, 2023
4 checks passed
@syphax-bouazzouni
Copy link
Collaborator

Done @Bilelkihal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants