-
Notifications
You must be signed in to change notification settings - Fork 259
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
Make sure the issuer of the ID Token is the correct one. #377
Conversation
Travis fails because #374 isn't accepted yet. Wrong of me, I was one step off :-/ |
src/oic/oic/message.py
Outdated
@@ -674,6 +675,13 @@ class IdToken(OpenIDSchema): | |||
def verify(self, **kwargs): | |||
super(IdToken, self).verify(**kwargs) | |||
|
|||
try: | |||
kwargs['iss'] == self['iss'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should this produce an AssertionError? no assert anywhere...
It is also not a great idea to use 'assert' for this kind of code, as 'assert' gets removed when someone runs python with optimization (-O), so logic fails.
So maybe just raise IssuerMismatch directly if the comparision fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, I should have know better.
1 similar comment
2 similar comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now.
🍺 |
Should not accept an ID Token from anyone but the expected one.