-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SAML/SSO #863
base: master
Are you sure you want to change the base?
Add SAML/SSO #863
Conversation
1e7c55e
to
ad50d3c
Compare
5ee0cbb
to
2994136
Compare
b6c4bbf
to
a3fcabe
Compare
@@ -34,6 +34,17 @@ class Application < Rails::Application | |||
# Skip views, helpers and assets when generating a new resource. | |||
config.api_only = true | |||
|
|||
# Use cookies for sessions | |||
config.session_store :cookie_store, key: '_keygen_session', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use a Session
model instead? It'd give us support for multiple sessions, plus auditability and revocability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could start with a UserSession
model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ref rails/rails#52328.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should do the session stuff in a separate PR?
module Auth | ||
class SsoController < Api::V1::BaseController | ||
include ActionController::Cookies | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This controller should assert the SSO entitlement, i.e. it should only be available in Keygen EE.
@@ -289,6 +289,16 @@ def protected? | |||
protected | |||
end | |||
|
|||
def sso? = sso_organization_id? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also check ent?
, or should we let this be open in case we sell an SSO add-on for Std tiers too?
# frozen_string_literal: true | ||
|
||
module Keygen | ||
module SSO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to EE namespace.
Closes #409. Implements SAML/SSO using WorkOS. Implements JIT-provisioning for new users.
This includes support for the following:
Each WorkOS connection costs us $125/mo, so this will be for Ent tiers only. Others can look into e.g. https://aglide.com.
Manual account setup right now, i.e. adding
sso_organization_id
, etc.:Prereqs
Subreqs