From 180e0183c5e2fc4e3cdbc5df22040f41d6495923 Mon Sep 17 00:00:00 2001 From: juanifioren Date: Tue, 21 Apr 2015 17:14:26 -0300 Subject: [PATCH] Validate expiration of access_token in UserInfo. --- oidc_provider/lib/endpoints/userinfo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oidc_provider/lib/endpoints/userinfo.py b/oidc_provider/lib/endpoints/userinfo.py index 3a7a48c..61e10e5 100644 --- a/oidc_provider/lib/endpoints/userinfo.py +++ b/oidc_provider/lib/endpoints/userinfo.py @@ -45,6 +45,9 @@ class UserInfoEndpoint(object): try: self.token = Token.objects.get(access_token=self.params.access_token) + if self.token.has_expired(): + raise UserInfoError('invalid_token') + except Token.DoesNotExist: raise UserInfoError('invalid_token')