Skip to content

DPC-5127 update portal to use multiple OIDC#2883

Open
jdettmannnava wants to merge 29 commits intomainfrom
jd/dpc-5127-multiple-oidc
Open

DPC-5127 update portal to use multiple OIDC#2883
jdettmannnava wants to merge 29 commits intomainfrom
jd/dpc-5127-multiple-oidc

Conversation

@jdettmannnava
Copy link
Contributor

@jdettmannnava jdettmannnava commented Jan 20, 2026

NOT FOR MERGE UNTIL CMS APPROVAL

🎫 Ticket

https://jira.cms.gov/browse/DPC-5127

🛠 Changes

  • Devise gems removed
  • Login-dot-gov provider renamed from openid_connect to login_dot_gov
  • Devise functionality manually restored
  • Tests updated

ℹ️ Context

We are moving to a multi-IDP environment. These IDPs use the OIDC protocol. Because of complexity, the Devise authentication gem only supports one openid_connect provider via the omniauth_openid_connect gem. Fortunately, we use very little Devise functionality, so removing the gem and replacing the necessary parts was not very extensive.

🧪 Validation

Automated tests updated to handle a world without devise.

Successfully logged in and out from localhost.
Successfully failed invitation flow.
Successfully passed invitation flow.

Post-Deploy Actions

After deployment, the following SQL will need to run in dpc-portal. This should not be a problem, as we are not in upper environments.
UPDATE users set provider = 'login_dot_gov';

@jdettmannnava jdettmannnava marked this pull request as ready for review January 21, 2026 16:58
@jdettmannnava jdettmannnava requested a review from a team as a code owner January 21, 2026 16:58
# and recreated between test runs. Don't rely on the data there!

Rails.application.configure do
config.colorize_logging = false
Copy link
Contributor

Choose a reason for hiding this comment

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

probably don't need to change this config setting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not necessary, but I found that it was difficult to analyze the logs because of their colorization, so I would prefer to leave this change in.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if this .find_or_create_by() needs to be updated to include login_dot_gov
e.g.

@user = User.find_or_create_by!(provider: :login_dot_gov,  uid: user_info['sub']) do |user_to_create|

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, this needs to change

@lukey-luke
Copy link
Contributor

✅ updated redirects look good
✅ tests are passing
✅ manual data update makes sense to me given existing 'openid_connect' for user.provider for current users.

Only open question I have is - does this capture intended behavior for provider column for newly created users?
I'll poke around more w/ local testing w/ creating a new invite later today

@jdettmannnava jdettmannnava requested review from a team and lukey-luke January 26, 2026 20:56
@lukey-luke
Copy link
Contributor

I confirmed that provider is set correctly for new users! Thanks for updating!

Screenshot 2026-01-26 at 2 54 38 PM

Copy link
Contributor

@MEspositoE14s MEspositoE14s left a comment

Choose a reason for hiding this comment

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

Makes sense to me!

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.

3 participants