New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDToken.validate_exp raises IDTokenError when exp is in the future #17

Avantol13 opened this Issue Jan 22, 2018 · 2 comments


None yet
2 participants

Avantol13 commented Jan 22, 2018

Doesn't the logic below need to flipped so that it only raises an IDTokenError when the exp is less than now (i.e. when the token expiration time is before now)?

    def validate_exp(self, now):
        if 'exp' not in self.token:
            raise IDTokenError('exp is required')
        if now and self.exp > now:  # <--- Shouldn't this be <= ?
            raise IDTokenError('exp is expired')

From OIDC 1.0:

REQUIRED. Expiration time on or after which the ID Token MUST NOT be accepted for processing.

@Avantol13 Avantol13 changed the title from `IDToken.validate_exp` raises IDTokenError when `exp` is in the future to IDToken.validate_exp raises IDTokenError when exp is in the future Jan 22, 2018

@lepture lepture added the bug label Jan 23, 2018

lepture added a commit that referenced this issue Jan 23, 2018


This comment has been minimized.


lepture commented Jan 23, 2018

@Avantol13 Thanks. This is a silly mistake. I've fixed it in master branch, it will be released together with v0.4.

Currently, there are not many test cases for OIDC. This method is not covered by tests.


This comment has been minimized.

Avantol13 commented Jan 23, 2018

Gotcha, yeah I figured the OIDC stuff is still in its infancy. Just wanted to make sure it was brought to your attention

@lepture lepture closed this Jan 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment