forked from innoq/statuses
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed innoq#148: introduce OpenId Connect
- the configuration initialization is now a function which called during server startup - the configuration instance will be passed as a parameter to the functions requiring it - added depenendcies to https://github.com/ddellacosta/friend-oauth2/ and https://github.com/cemerick/friend - modified routing.clj to secure all requests via `allow-anon? false` - upon first request to `/statuses/updates`, you are now redirected to the innoq-internal oAuth2/ OpenID connect server - added configuration properties for the oAuth2 process - introduced avatar image beneath the statuses logo at the top left to indicate currently active user
- Loading branch information
1 parent
0c7a4a1
commit 0dcc1e1
Showing
9 changed files
with
204 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
{:title "innoQ Status Updates" | ||
:database-path "data/db.json" | ||
:save-interval 2 | ||
:http-port 8080 | ||
:host "localhost" | ||
:run-mode :prod | ||
{:title "innoQ Status Updates" | ||
:database-path "data/db.json" | ||
:save-interval 2 | ||
:host "localhost" | ||
:http-port 8080 | ||
:external-url "http://localhost:8080" | ||
:external-url-path "/statuses" | ||
:run-mode :dev | ||
; {username} is replaced with the username | ||
:avatar-url "https://.../users/{username}/avatar/32x32" | ||
:avatar-url "https://testldap.innoq.com/liqid/users/{username}/avatar/32x32" | ||
;:avatar-url "http://assets.github.com/images/gravatars/gravatar-user-420.png" | ||
:profile-url-prefix "https://intern.innoq.com/liqid/users/"} | ||
:profile-url-prefix "https://testldap.innoq.com/liqid/users/" | ||
:entry { | ||
:min-length 1 | ||
:max-length 140} | ||
; set the following parameters to enable openID connect authentication | ||
:oauth-server-authorize-uri "https://testldap.innoq.com/openid/authorize" | ||
:oauth-server-token-uri "https://testldap.innoq.com/openid/token" | ||
:oauth-server-userinfo-uri "https://testldap.innoq.com/openid/userinfo" | ||
:oauth-client-id "08f74afd-aa5a-4fda-b506-56955ed0089a" | ||
:oauth-client-secret "ANPgFiTvF9-1FoNrOMwCls36CEIYC1to6J4vjQJuFwKwCGtuRnvbx1zFHmqCuKG0fFZPfOdd9GdGF3Qd67p87wc" | ||
; registration-access-token "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(ns oauth | ||
(:use clojure.test | ||
[statuses.routing :only [extract-access-token]])) | ||
|
||
(deftest extract-access-token-from-body | ||
(is | ||
(= | ||
(extract-access-token {:body "{\"access_token\":\"test.A-JEKLslDlCv5uO0SmH_TWB9SHxLuk9IqITcWk1ZvA\"}"}) | ||
"test.A-JEKLslDlCv5uO0SmH_TWB9SHxLuk9IqITcWk1ZvA"))) |