diff --git a/backend/src/app/auth/oidc.clj b/backend/src/app/auth/oidc.clj index 09d34532b9..ecf8b658a5 100644 --- a/backend/src/app/auth/oidc.clj +++ b/backend/src/app/auth/oidc.clj @@ -776,7 +776,7 @@ (defn prepare-organization-sso-provider "Build an OIDC provider map dynamically from the Nitrate organization SSO config. - Uses OIDC discovery via :issuer when token/auth/user URIs are absent." + Uses OIDC discovery via :issuer when token/auth/user URIs are absent." [cfg {:keys [client-id client-secret issuer]}] (prepare-oidc-provider cfg {:type "oidc" @@ -785,8 +785,7 @@ :base-uri (some-> (non-blank-uri issuer) (str/rtrim "/") (str "/")) - :scopes default-oidc-scopes - :skip-ssrf-check? true})) + :scopes default-oidc-scopes})) (defn build-organization-sso-auth-redirect-uri "Build the OIDC authorization redirect URI for an organization SSO config. diff --git a/backend/test/backend_tests/auth_oidc_test.clj b/backend/test/backend_tests/auth_oidc_test.clj index 22ccb624fe..62f04fd546 100644 --- a/backend/test/backend_tests/auth_oidc_test.clj +++ b/backend/test/backend_tests/auth_oidc_test.clj @@ -518,3 +518,16 @@ loc (redirect-location result)] (t/is (= 302 (::yres/status result))) (t/is (.contains loc "error=unable-to-auth"))))))) + +(t/deftest prepare-organization-sso-provider-does-not-skip-ssrf-check + (t/testing "organization SSO provider must use SSRF protection" + (let [captured-params (atom nil)] + (with-redefs [oidc/prepare-oidc-provider (fn [_cfg params] + (reset! captured-params params) + {:type "oidc" :id "test"})] + (#'oidc/prepare-organization-sso-provider {} + {:client-id "test-client" + :client-secret "test-secret" + :issuer "https://idp.example.com"}) + (t/is (not (true? (:skip-ssrf-check? @captured-params))) + "SSRF protection must be disabled for organization SSO")))))