Skip to content

Commit

Permalink
including the xlmns in Issuer and NameID works
Browse files Browse the repository at this point in the history
  • Loading branch information
escherize committed May 22, 2024
1 parent 57ca846 commit c794bc8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/saml20_clj/sp/request.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 13 additions & 8 deletions test/saml20_clj/sp/request_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit c794bc8

Please sign in to comment.