Created
August 23, 2012 20:19
-
-
Save eedrummer/3441170 to your computer and use it in GitHub Desktop.
Patch for exp not being in IdToken
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
diff --git a/config.ru b/config.ru | |
index 88a4115..d453cc6 100644 | |
--- a/config.ru | |
+++ b/config.ru | |
@@ -7,6 +7,31 @@ require 'warden' | |
require 'warden_omniauth' | |
require 'yaml' | |
+module OpenIDConnect | |
+ class AccessToken | |
+ def authenticate(req) | |
+ req.header.request_query ||={} | |
+ req.header.request_query['access_token'] = access_token | |
+ end | |
+ | |
+ end | |
+end | |
+ | |
+ | |
+module OpenIDConnect | |
+ class ResponseObject | |
+ class IdToken | |
+ attr_optional :exp | |
+ def verify!(expected = {}) | |
+ iss == expected[:issuer] && | |
+ aud == expected[:client_id] && | |
+ nonce == expected[:nonce] or | |
+ raise InvalidToken.new('Invalid ID Token') | |
+ end | |
+ end | |
+ end | |
+end | |
+ | |
SESSION_KEY = 'rack.session' | |
class WardenOmniAuth | |
def call(env) | |
@@ -136,4 +161,4 @@ omni_user | |
end | |
# run the stack | |
-run app | |
\ No newline at end of file | |
+run app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment