test with ngrok
This commit is contained in:
parent
83660b47f7
commit
834f880fa8
3 changed files with 12 additions and 13 deletions
2
Gemfile
2
Gemfile
|
@ -135,7 +135,7 @@ gem 'stripe'
|
||||||
## to populate db with sample data
|
## to populate db with sample data
|
||||||
gem 'faker'
|
gem 'faker'
|
||||||
|
|
||||||
gem 'ruby-saml', '~> 1.14'
|
gem 'ruby-saml', '= 1.11'
|
||||||
|
|
||||||
group :production, :staging do
|
group :production, :staging do
|
||||||
# we dont want request timing out in development while using byebug
|
# we dont want request timing out in development while using byebug
|
||||||
|
|
|
@ -558,9 +558,8 @@ GEM
|
||||||
rubocop-rspec (2.12.1)
|
rubocop-rspec (2.12.1)
|
||||||
rubocop (~> 1.31)
|
rubocop (~> 1.31)
|
||||||
ruby-progressbar (1.11.0)
|
ruby-progressbar (1.11.0)
|
||||||
ruby-saml (1.14.0)
|
ruby-saml (1.11.0)
|
||||||
nokogiri (>= 1.10.5)
|
nokogiri (>= 1.5.10)
|
||||||
rexml
|
|
||||||
ruby-vips (2.1.4)
|
ruby-vips (2.1.4)
|
||||||
ffi (~> 1.12)
|
ffi (~> 1.12)
|
||||||
ruby2_keywords (0.0.5)
|
ruby2_keywords (0.0.5)
|
||||||
|
@ -776,7 +775,7 @@ DEPENDENCIES
|
||||||
rubocop-performance
|
rubocop-performance
|
||||||
rubocop-rails
|
rubocop-rails
|
||||||
rubocop-rspec
|
rubocop-rspec
|
||||||
ruby-saml (~> 1.14)
|
ruby-saml (= 1.11)
|
||||||
scout_apm
|
scout_apm
|
||||||
seed_dump
|
seed_dump
|
||||||
sentry-rails (~> 5.3)
|
sentry-rails (~> 5.3)
|
||||||
|
|
|
@ -11,7 +11,7 @@ class SamlController < ApplicationController
|
||||||
def consume
|
def consume
|
||||||
response = OneLogin::RubySaml::Response.new(params['SAMLResponse'])
|
response = OneLogin::RubySaml::Response.new(params['SAMLResponse'])
|
||||||
response.settings = saml_settings
|
response.settings = saml_settings
|
||||||
|
binding.pry
|
||||||
# We validate the SAML Response and check if the user already exists in the system
|
# We validate the SAML Response and check if the user already exists in the system
|
||||||
if response.is_valid?
|
if response.is_valid?
|
||||||
# authorize_success, log the user
|
# authorize_success, log the user
|
||||||
|
@ -58,20 +58,20 @@ class SamlController < ApplicationController
|
||||||
|
|
||||||
settings.soft = true
|
settings.soft = true
|
||||||
|
|
||||||
settings.assertion_consumer_service_url = 'https://staging.chatwoot.com/saml/consume'
|
settings.assertion_consumer_service_url = 'https://f222-49-248-88-43.in.ngrok.io/saml/consume'
|
||||||
settings.sp_entity_id = 'https://staging.chatwoot.com/saml/metadata'
|
settings.sp_entity_id = 'https://f222-49-248-88-43.in.ngrok.io/saml/metadata'
|
||||||
|
|
||||||
settings.idp_entity_id = 'https://app.onelogin.com/saml2'
|
settings.idp_entity_id = 'https://app.onelogin.com/saml/metadata/c65ea300-da14-44bc-989e-1e374d17b1a8'
|
||||||
settings.idp_sso_target_url = 'https://chatwoot-dev.onelogin.com/trust/saml2/http-redirect/sso/ef91ee22-a899-4a96-8329-0381dbdf71cf'
|
settings.idp_sso_target_url = 'https://chatwoot-dev.onelogin.com/trust/saml2/http-post/sso/c65ea300-da14-44bc-989e-1e374d17b1a8'
|
||||||
settings.idp_slo_target_url = 'https://chatwoot-dev.onelogin.com/trust/saml2/http-redirect/slo/1857853'
|
settings.idp_slo_target_url = 'https://chatwoot-dev.onelogin.com/trust/saml2/http-redirect/slo/1858161'
|
||||||
|
|
||||||
settings.name_identifier_format = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress'
|
settings.name_identifier_format = 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient'
|
||||||
settings.idp_cert_fingerprint = 'FD:17:5E:81:F8:F5:88:EF:21:AB:94:44:3E:4A:C4:72:94:E2:63:AE'
|
settings.idp_cert_fingerprint = 'FD:17:5E:81:F8:F5:88:EF:21:AB:94:44:3E:4A:C4:72:94:E2:63:AE'
|
||||||
settings.idp_cert_fingerprint_algorithm = 'http://www.w3.org/2000/09/xmldsig#sha1'
|
settings.idp_cert_fingerprint_algorithm = 'http://www.w3.org/2000/09/xmldsig#sha1'
|
||||||
|
|
||||||
# Optional bindings (defaults to Redirect for logout POST for ACS)
|
# Optional bindings (defaults to Redirect for logout POST for ACS)
|
||||||
settings.single_logout_service_binding = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect' # or :post, :redirect
|
settings.single_logout_service_binding = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect' # or :post, :redirect
|
||||||
settings.assertion_consumer_service_binding = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect' # or :post, :redirect
|
settings.assertion_consumer_service_binding = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST' # or :post, :redirect
|
||||||
|
|
||||||
settings
|
settings
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue