Repository navigation
OTWO-7707 Implemented OKTA AUTH for admins - #1944
Open
bd-vaibhav wants to merge 2 commits into
Open
bd-vaibhav wants to merge 2 commits into
bd-vaibhav wants to merge 2 commits into
Conversation
bd-vaibhav
requested review from
Niharika1117 and
Priya5
and
a lite review from Copilot
August 14, 2026 09:17
There was a problem hiding this comment.
Pull request overview
This PR introduces Okta SAML-based authentication for admin accounts, including an SSO redirect flow, Okta session-expiry enforcement, and a Global Token Revocation (GTR) endpoint.
Changes:
- Added OmniAuth SAML middleware/configuration and routes for SAML callback + GTR.
- Updated session handling to route admins through an Okta SSO redirect (with exclusions) and added an admin Okta-session expiry check in
ApplicationController. - Added controller/view/test coverage for the SAML callback flow, admin login redirect, and GTR endpoint behavior.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
app/controllers/sessions_controller.rb |
Routes authenticated admins into Okta SSO flow or direct sign-in when excluded. |
app/controllers/saml_controller.rb |
Handles OmniAuth SAML callback and defines the GTR endpoint (plus bearer auth verification). |
app/controllers/application_controller.rb |
Adds a global before_action to enforce Okta session freshness for admins. |
app/views/sessions/saml_redirect.html.erb |
Adds the intermediate SSO “Continue” form that POSTs into OmniAuth. |
config/initializers/omniauth.rb |
Configures OmniAuth SAML provider and restricts request methods to POST. |
config/routes.rb |
Adds POST routes for SAML callback and GTR endpoint. |
config/locales/en.yml |
Adds flash strings for SAML mismatch and Okta session expiry. |
Gemfile |
Adds omniauth-saml and omniauth-rails_csrf_protection. |
test/controllers/sessions_controller_test.rb |
Adds coverage for admin login rendering SAML redirect and excluded-admin bypass. |
test/controllers/saml_controller_test.rb |
Adds coverage for SAML callback success/failure paths, session expiry behavior, and GTR authorization checks. |
Suppressed comments (1)
test/controllers/saml_controller_test.rb:88
- This test stubs
Rails.cache.read/deletewithout asserting the expected cache key. That can let regressions slip through (e.g., reading/deleting the wrong key) while the test still passes.
Rails.cache.stubs(:read).returns(cache_data)
Rails.cache.stubs(:delete).returns(true)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bd-vaibhav
force-pushed
the
OTWO-7707
branch
2 times, most recently
from
August 21, 2026 10:36
9003548 to
dce2dfb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.