Skip to content

OpenID Connect Support#1690

Closed
JPrevost wants to merge 1 commit into
o19s:mainfrom
MITLibraries:add-openid-connect-support
Closed

OpenID Connect Support#1690
JPrevost wants to merge 1 commit into
o19s:mainfrom
MITLibraries:add-openid-connect-support

Conversation

@JPrevost
Copy link
Copy Markdown
Contributor

Description

  • OpenID Connect is a popular authentication protocol that allows users to log in using their existing accounts from other providers.
  • Adding support for OpenID Connect will enhance the user experience by providing more login options.
  • This feature is disabled by default, so sites not wishing to provide it are not affected.
  • All existing authentication options remain unchanged.

How does this address that need:

  • Implemented OpenID Connect support using the omniauth-openid-connect gem. This models the similar implementation in place in this codebase for Keycloak and Google.

Motivation and Context

#1287

How Has This Been Tested?

We are using this configuration against an Okta OpenId Connect provider in our local environment.

Screenshots or GIFs (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Why are these changes being introduced:

* OpenID Connect is a popular authentication protocol that allows users
  to log in using their existing accounts from other providers.
* Adding support for OpenID Connect will enhance the user experience by
  providing more login options.

How does this address that need:

* Implemented OpenID Connect support using the omniauth-openid-connect
  gem. This models the similar implementation in place in this codebase
  for Keycloak and Google.

Document any side effects to this change:

* Some typos were fixed in the documentation and code comments not
  directly related to OpenID Connect support.
Copy link
Copy Markdown
Member

@epugh epugh left a comment

Choose a reason for hiding this comment

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

This is looking really good... I wonder, can we drop the Keycloak set up and use openid to connect wiht Keycloak? Any suggestions on how to test this?

# comments on the other flows imply that this is only for new users, which is not the case so it is not entirely
# clear what the intent is. If the intent is to only create a case for new users, then we should probably check
# if the user is new before creating a case.
@user.cases.build case_name: "Case #{@user.cases.size}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You know what, I think this is leftover from the dark ages when we didn't have a "homepage" for Quepid. You literally just got dropped right into the Case creation screen.

I think we don't need this, and honestly, probably should remove them from the others as well.

Also, when we formalize the "Judge (Rater) user persona" they won't even ever see cases!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Gotcha, that makes sense. Would you prefer I remove it from this OpenID Connect configuration or leave it so you can clean them all up at the same time?


<% if Rails.application.config.devise.omniauth_providers.include?(:openid_connect) %>
<% email_login_only = false %>
<!-- <a href="https://www.flaticon.com/free-icons/digital" title="digital icons">Digital icons created by Freepik - Flaticon</a> -->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

??? Do we need this for crediting the image origin?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I copied this from the other implementations. I figured someone made a decision to do that intentionally in the past so I just went with it. I'm happy to adjust or leave as-is based on your preference.

Comment thread .env.example

# OAuth Settings
# OAuth Settings: remove these to disable Google OAuth or set them to your own values
GOOGLE_CLIENT_ID=your_google_client_id
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i wonder if we need to comment out these settings so when users first fire it up, they get reasonable defaults? I believe the setup script just copies .env.example to .env, so mayb we need to comment these? The keycload one is there I guess becasue when you fire up quepid in dev mode we already have it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe we need GOOGLE_CLIENT_ID= #your_google_client_id ???

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Defaults are hard for sure and I don't have a sense how frequently people benefit from having the non-functional Google option showing. It might be good so they know it is an option and just needs proper configuration, or it might be really frustrating. Personally I didn't really mind it the way it is and it didn't take long to figure out I needed to comment it out to make it go away.

@JPrevost
Copy link
Copy Markdown
Contributor Author

@epugh While a Keycload server can provide OpenID Connect services, I'm not confident whether the integration in this app is using OpenID Connect or another supported Keycloak authentication flow.

I suspect, but have not confirmed, removing the direct Keycloak option from Quepid would be a breaking change that requires re-configuration at best so I'd suggest if you want to remove the option it would be best to deprecate it first with a timeline to removal just in case it is in active use in production someplace.

@epugh
Copy link
Copy Markdown
Member

epugh commented Apr 21, 2026

Hi @JPrevost I wanted to give you an update that I have been working on how to use Keycloak with OpenID directly.. I ran into one hiccup which is our dev Keycloak runs on http, not https, and that is an issue. I found a ugly workaround, and then have opened up omniauth/omniauth_openid_connect#211.

If we do get this PR in, then we can actually REMOVE the omniauth-keycloak gem. I have not pushed up my local changes to your PR yet pending the other PR getting in.

If this is holding you up, we could merge this PR, and then when the openid PR lands, then do the refactoring thiere.

@epugh
Copy link
Copy Markdown
Member

epugh commented Apr 21, 2026

This is the local version of my refactor... eric_refactor.patch

@JPrevost
Copy link
Copy Markdown
Contributor Author

@epugh We are not blocked at all with this. We're using a fork with our OpenID Connect support in place and will eventually retire the fork if it lands here. No rush and thanks for taking the time to consider how best this fits in the app longterm.

@epugh
Copy link
Copy Markdown
Member

epugh commented May 3, 2026

are you on relevance slack #quepid channel?

@epugh
Copy link
Copy Markdown
Member

epugh commented May 13, 2026

Okay, I've beat my head on this for a long time, but I haven't been able to get the omniauth-openid gem to get updated. I'm going to push a fix or two here, and call it good.

@epugh epugh mentioned this pull request May 13, 2026
7 tasks
@epugh
Copy link
Copy Markdown
Member

epugh commented May 13, 2026

I ran into merge conflicts, so opened up #1701...

@epugh epugh closed this May 13, 2026
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.

2 participants