Skip to content

Instantly share code, notes, and snippets.

@eedrummer
Created August 23, 2012 20:19
Show Gist options
  • Save eedrummer/3441170 to your computer and use it in GitHub Desktop.
Save eedrummer/3441170 to your computer and use it in GitHub Desktop.
Patch for exp not being in IdToken
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