From 06a4e0783c1886ca46468c4caeb42a41d56fd956 Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 5 Mar 2025 12:26:47 -0700 Subject: refactor: move SAML routes to /saml/ path --- bin/idp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'bin/idp') diff --git a/bin/idp b/bin/idp index 026655c1..fd8cc3e2 100755 --- a/bin/idp +++ b/bin/idp @@ -13,9 +13,9 @@ gemfile do gem "webrick", "~> 1.0" end -$scheme = ENV.fetch('SCHEME', 'http') -$port = ENV.fetch('PORT', 8282).to_i -$host = ENV.fetch('HOST', "localhost:#{$port}") +$scheme = ENV.fetch("SCHEME", "http") +$port = ENV.fetch("PORT", 8282).to_i +$host = ENV.fetch("HOST", "localhost:#{$port}") class JWT attr_reader :claims @@ -66,7 +66,7 @@ class OnDemandRegistry < Saml::Kit::DefaultRegistry end Saml::Kit.configure do |x| - x.entity_id = "#{$scheme}://#{$host}/metadata.xml" + x.entity_id = "#{$scheme}://#{$host}/saml/metadata.xml" x.registry = OnDemandRegistry.new x.logger = Logger.new("/dev/stderr") end @@ -83,7 +83,7 @@ class IdentityProvider return oauth_metadata when '/.well-known/webfinger' # RFC-7033 return not_found - when "/metadata.xml" + when "/saml/metadata.xml" return saml_metadata when "/saml/new" # TODO:: render a login page @@ -117,9 +117,6 @@ class IdentityProvider private - # Download IDP Metadata - # - # GET /metadata.xml def saml_metadata xml = Saml::Kit::Metadata.build_xml do |builder| builder.contact_email = 'hi@example.com' -- cgit v1.2.3