#2: Started work, not yet working.
This commit is contained in:
parent
039b0eef3c
commit
a6abeaa679
|
@ -2,7 +2,7 @@
|
||||||
{% block big-links %}
|
{% block big-links %}
|
||||||
{% for authority in authorities %}
|
{% for authority in authorities %}
|
||||||
<div class="big-link-container">
|
<div class="big-link-container">
|
||||||
<a href="auth?authority={{authority.id}}" class="big-link" id="{{authority.id}}-link">
|
<a href="oauth/oauth-init?authority={{authority.id}}" class="big-link" id="{{authority.id}}-link">
|
||||||
<img src="img/authorities/{{authority.id}}.png" width="32" height="32" alt="{{authority.id}}"/>
|
<img src="img/authorities/{{authority.id}}.png" width="32" height="32" alt="{{authority.id}}"/>
|
||||||
{{authority.id}}
|
{{authority.id}}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -6,17 +6,25 @@
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
[youyesyet.oauth :as oauth]))
|
[youyesyet.oauth :as oauth]))
|
||||||
|
|
||||||
|
|
||||||
(defn oauth-init
|
(defn oauth-init
|
||||||
"Initiates the OAuth with the authority implied by this `request`"
|
"Initiates the OAuth with the authority implied by this `request`"
|
||||||
[request]
|
[request]
|
||||||
;; (-> (oauth/fetch-request-token request)
|
(let [authority (or
|
||||||
;; :oauth_token
|
(:authority (:session request))
|
||||||
;; oauth/auth-redirect-uri
|
(oauth/authority! (:authority (massage-params :request))))]
|
||||||
;; found))
|
(if
|
||||||
|
authority
|
||||||
|
(assoc-in
|
||||||
(found
|
(found
|
||||||
(oauth/auth-redirect-uri
|
(oauth/auth-redirect-uri
|
||||||
(:oauth_token (oauth/fetch-request-token request))
|
(:request-token
|
||||||
(:authority (:session request)))))
|
(oauth/fetch-request-token request authority))
|
||||||
|
authority))
|
||||||
|
[:session :authority]
|
||||||
|
authority))))
|
||||||
|
:session
|
||||||
|
|
||||||
|
|
||||||
(defn oauth-callback
|
(defn oauth-callback
|
||||||
"Handles the callback from the authority."
|
"Handles the callback from the authority."
|
||||||
|
|
Loading…
Reference in a new issue