forked from bostonaholic/ring-okta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
saml.clj.html
53 lines (53 loc) · 3.2 KB
/
saml.clj.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../coverage.css"/> <title> ring/ring_okta/saml.clj </title>
</head>
<body>
<span class="covered" title="1 out of 1 forms covered">
001 (ns ring.ring-okta.saml
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
002 (:require [clojure.data.codec.base64 :as b64]
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
003 [clojure.string :as string])
</span><br/>
<span class="not-tracked" title="0 out of 0 forms covered">
004 (:import (com.okta.saml SAMLValidator)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
005
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
006 (defn- get-valid-user-id [saml-response okta-config validator]
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
007 (let [config (.getConfiguration validator okta-config)
</span><br/>
<span class="not-covered" title="0 out of 5 forms covered">
008 decoded-saml-response (String. (b64/decode (.getBytes saml-response "UTF-8")))
</span><br/>
<span class="not-covered" title="0 out of 3 forms covered">
009 valid-saml-response (.getSAMLResponse validator decoded-saml-response config)]
</span><br/>
<span class="not-covered" title="0 out of 1 forms covered">
010 (.getUserID valid-saml-response)))
</span><br/>
<span class="blank" title="0 out of 0 forms covered">
011
</span><br/>
<span class="covered" title="1 out of 1 forms covered">
012 (defn respond-to-okta-post [okta-config params]
</span><br/>
<span class="covered" title="6 out of 6 forms covered">
013 {:redirect-url (:RelayState params)
</span><br/>
<span class="covered" title="2 out of 2 forms covered">
014 :authenticated-user-email (string/lower-case
</span><br/>
<span class="covered" title="7 out of 7 forms covered">
015 (get-valid-user-id (:SAMLResponse params) okta-config (SAMLValidator.)))})
</span><br/>
</body>
</html>