Skip to content

Implementing SSO#230

Open
kevin-atnos wants to merge 12 commits intomasterfrom
sso
Open

Implementing SSO#230
kevin-atnos wants to merge 12 commits intomasterfrom
sso

Conversation

@kevin-atnos
Copy link
Copy Markdown
Collaborator

@kevin-atnos kevin-atnos commented Oct 17, 2023

This pull request introduces significant updates to the application, focusing on adding SAML-based single sign-on (SSO) support, improving database query performance, and enhancing configuration and session management. Below is a summary of the most important changes grouped by theme.

SAML-Based Single Sign-On (SSO) Integration:

  • Added SamlController to handle SAML metadata, SSO, logout, and SLO responses, enabling SAML-based authentication workflows (app/controllers/saml_controller.rb).
  • Configured SAML-related routes for metadata, SSO, logout, and assertion consumer services in config/routes.rb.
  • Updated devise initializer with commented-out SAML configuration options to support SAML-based user authentication (config/initializers/devise.rb).

Performance Improvements:

  • Modified Pia and PiaPolicy queries to use eager_load for preloading associated user_pias, reducing N+1 query issues (app/controllers/pias_controller.rb, app/policies/pia_policy.rb) [1] [2].

Session and Configuration Enhancements:

  • Configured Redis as the session store and enabled session management middleware for better scalability and performance (config/initializers/session_store.rb).
  • Added config.secret_key_base to config/application.rb for secure application configuration (config/application.rb).

Dependency Updates:

  • Added new gems: ruby-saml and devise_saml_authenticatable for SAML authentication, and redis with redis-actionpack for Redis-based session storage (Gemfile).

Minor Code and Syntax Improvements:

  • Updated syntax for hash shorthand and string quoting in various files for consistency (app/models/user.rb, config/application.rb) [1] [2].

Comment thread app/controllers/saml_controller.rb Fixed
Comment thread app/controllers/saml_controller.rb Fixed
Comment thread app/controllers/saml_controller.rb Fixed
Comment thread app/controllers/saml_controller.rb Fixed
Comment thread app/controllers/saml_controller.rb Dismissed
Comment thread app/controllers/saml_controller.rb Dismissed
@kevin-atnos
Copy link
Copy Markdown
Collaborator Author

kevin-atnos commented Jan 24, 2024

@brunto brunto changed the base branch from master to rails_8.0 May 12, 2025 14:53
@brunto brunto changed the base branch from rails_8.0 to master May 19, 2025 20:38
@brunto brunto requested review from brunto and Copilot May 19, 2025 20:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements Single Sign-On (SSO) functionality by adding new SAML routes and controllers, updating session management with Redis, and configuring SAML settings in Devise.

  • Added SAML routes in routes.rb
  • Introduced a new SamlController that handles SSO, ACS, and SLO flows
  • Updated session store and extended Devise initializer with commented SAML config for future adjustments

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
config/routes.rb Added SAML endpoints for metadata, SSO, ACS, logout, and SLO handling
config/initializers/session_store.rb Configured Redis as the session store with updated parameters
config/initializers/devise.rb Enabled email authentication and provided commented sample SAML settings
config/application.rb Minor changes with stylistic quote updates and added secret_key_base
app/policies/pia_policy.rb Switched to eager loading of associated records for performance improvements
app/models/user.rb Updated login uniqueness validation using Ruby shorthand, but with issues
app/controllers/saml_controller.rb Introduced new controller handling SSO requests and SAML attribute population
app/controllers/pias_controller.rb Adjusted association loading for performance
app/controllers/application_controller.rb Extended info API to include SSO enabled flag
Gemfile Added new dependencies for ruby-saml, devise_saml_authenticatable, and Redis

Comment thread app/models/user.rb
brunto
brunto previously approved these changes Jul 18, 2025
Comment thread config/application.rb Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants