diff --git a/src/saml20_clj/sp/request.clj b/src/saml20_clj/sp/request.clj index ae20bb8..7cd402e 100644 --- a/src/saml20_clj/sp/request.clj +++ b/src/saml20_clj/sp/request.clj @@ -109,8 +109,9 @@ :ID (or request-id (str "id" (random-uuid))) :IssueInstant instant :Destination idp-url} - [:Issuer issuer] - [:NameID {:Format "urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress"} user-email]]) + [:Issuer {:xmlns "urn:oasis:names:tc:SAML:2.0:assertion"} issuer] + [:NameID {:xmlns "urn:oasis:names:tc:SAML:2.0:assertion" + :Format "urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress"} user-email]]) (defn logout-redirect-location "This returns a url that you'd want to redirect a client to. Either using diff --git a/test/saml20_clj/sp/request_test.clj b/test/saml20_clj/sp/request_test.clj index cfc86b0..0b9125e 100644 --- a/test/saml20_clj/sp/request_test.clj +++ b/test/saml20_clj/sp/request_test.clj @@ -201,15 +201,20 @@ :idp-url "http://idp.example.com/SSOService.php" :issuer "http://sp.example.com/demo1/metadata.php"}))] (is (= [:samlp:LogoutRequest - {:xmlns "urn:oasis:names:tc:SAML:2.0:protocol" - :xmlns:samlp "urn:oasis:names:tc:SAML:2.0:protocol" - :xmlns:saml "urn:oasis:names:tc:SAML:2.0:assertion" - :Version "2.0" - :ID "ONELOGIN_109707f0030a5d00620c9d9df97f627afe9dcc24" - :IssueInstant "2020-09-24T22:51:00Z" + {:xmlns "urn:oasis:names:tc:SAML:2.0:protocol", + :xmlns:samlp "urn:oasis:names:tc:SAML:2.0:protocol", + :xmlns:saml "urn:oasis:names:tc:SAML:2.0:assertion", + :Version "2.0", + :ID "ONELOGIN_109707f0030a5d00620c9d9df97f627afe9dcc24", + :IssueInstant "2020-09-24T22:51:00Z", :Destination "http://idp.example.com/SSOService.php"} - [:Issuer "http://sp.example.com/demo1/metadata.php"] - [:NameID {:Format "urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress"} "user@example.com"]] + [:Issuer + {:xmlns "urn:oasis:names:tc:SAML:2.0:assertion"} + "http://sp.example.com/demo1/metadata.php"] + [:NameID + {:xmlns "urn:oasis:names:tc:SAML:2.0:assertion", + :Format "urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress"} + "user@example.com"]] logout-xml)))) (t/with-clock (t/mock-clock (t/instant "2020-09-24T22:51:00.000Z"))