mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Multi-provider SSO support: - Database-backed SSO provider management with admin UI - Support for OpenID Connect, Google OAuth2, GitHub, and SAML 2.0 - Flipper feature flag (db_sso_providers) for dynamic provider loading - ProviderLoader service for YAML or database configuration Admin functionality: - Admin::SsoProvidersController for CRUD operations - Admin::UsersController for super_admin role management - Pundit policies for authorization - Test connection endpoint for validating provider config User provisioning improvements: - JIT (just-in-time) account creation with configurable default role - Changed default JIT role from admin to member (security) - User attribute sync on each SSO login - Group/role mapping from IdP claims SSO identity management: - Settings::SsoIdentitiesController for users to manage connected accounts - Issuer validation for OIDC identities - Unlink protection when no password set Audit logging: - SsoAuditLog model tracking login, logout, link, unlink, JIT creation - Captures IP address, user agent, and metadata Advanced OIDC features: - Custom scopes per provider - Configurable prompt parameter (login, consent, select_account, none) - RP-initiated logout (federated logout to IdP) - id_token storage for logout SAML 2.0 support: - omniauth-saml gem integration - IdP metadata URL or manual configuration - Certificate and fingerprint validation - NameID format configuration
22 lines
586 B
Ruby
22 lines
586 B
Ruby
class CreateSsoProviders < ActiveRecord::Migration[7.2]
|
|
def change
|
|
create_table :sso_providers, id: :uuid do |t|
|
|
t.string :strategy, null: false
|
|
t.string :name, null: false
|
|
t.string :label, null: false
|
|
t.string :icon
|
|
t.boolean :enabled, null: false, default: true
|
|
t.string :issuer
|
|
t.string :client_id
|
|
t.string :client_secret
|
|
t.string :redirect_uri
|
|
t.jsonb :settings, null: false, default: {}
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
add_index :sso_providers, :name, unique: true
|
|
add_index :sso_providers, :enabled
|
|
end
|
|
end
|