Skip to content

change auth strategy from warden to Azure AD UMGs#257

Merged
Alex Kiessling (ajkiessl) merged 9 commits intomainfrom
228-umg-auth
Mar 12, 2026
Merged

change auth strategy from warden to Azure AD UMGs#257
Alex Kiessling (ajkiessl) merged 9 commits intomainfrom
228-umg-auth

Conversation

@Smullz622
Copy link
Contributor

@Smullz622 Sarah Smulligan (Smullz622) commented Mar 4, 2026

Fixes #228

I wasn't quite able to wrap this up, but it's mostly there. Everything works locally, new authorized users and admin umg groups have been created, & the feature specs are fixed.

To be completed:

  • fix failing request specs
  • add azure tests
  • add remainder of authorized users (currently just has dev team, Binky, & Justin, I was waiting for everything to be wrapped up before adding remaining users) Moved here: Release tasks #266

…require_login to auto_login and use a view with a little JS to login
…odifues mocked authentication to use ClimateControl for setting ENV variables. Converts gui_auth_spec from warden tests, to new session controller authentication. Moves sidekiq_access_spec to /admin and fixes those to work with new auth. Fixes AuthHelper for logging in to redirect to the callback url which triggers the session creation
@ajkiessl Alex Kiessling (ajkiessl) marked this pull request as ready for review March 12, 2026 18:49
@ajkiessl Alex Kiessling (ajkiessl) requested a review from a team as a code owner March 12, 2026 18:49
@ajkiessl
Copy link
Contributor

Jesse LE (@jlandiseigsti)
Sarah Smulligan (@Smullz622)

This is done and ready for review. Some of the things I did:

  • Removed GET from list of omniauth request methods. This protects from CSRF attacks.
  • Changed GUIAuthController to require auto_login before each action. This redirects to a page that automatically "clicks" a hidden login button, forcing a POST to the omniauth endpoint and passing along CSRF tokens.
  • Fixed up the feature and request specs that had not yet implemented login_gui_user
  • Use ClimateControl to set ENV variables in mock authentication for tests
  • Replace gui_auth_spec.rb with sessions_controller_spec.rb to test the sessions controller actions and the auto_login before_action.

Copy link
Contributor

@jlandiseigsti Jesse LE (jlandiseigsti) left a comment

Choose a reason for hiding this comment

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

Every thing looks good to me.

Are we going to implement logout separately?


get '/auth/azure_oauth/callback', to: 'sessions#create'
get '/auth/failure', to: 'sessions#failure'
delete '/logout', to: 'sessions#destroy'
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this connected to anything at the moment?

Copy link
Contributor

Choose a reason for hiding this comment

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

The RailsAdmin UI actually has a link in the top right to log out. That hooks into this route. I think that's just a default for RailsAdmin, though. We could implement a logout button in the future, but I think we'd need a neutral landing page for that. Everything is behind auth, so you'd just get logged back in after logging out.

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be pretty simple to remove the auto login stuff, and replace it with login and log out buttons, though. Most of our other apps do that. But I'm curious to see how the auto login works.

@ajkiessl Alex Kiessling (ajkiessl) merged commit d348f83 into main Mar 12, 2026
3 checks passed
@ajkiessl Alex Kiessling (ajkiessl) deleted the 228-umg-auth branch March 12, 2026 20:50
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.

Modify authentication to pull users' UMGs and match to an authorized group

3 participants