-
Notifications
You must be signed in to change notification settings - Fork 25
Handle all exceptions #94
Conversation
As you can see in oidcop/exception.py the idea was that there would be a package specific exception which all the exceptions in that package inherited from. |
Having said that we still will have exception that belong to OidcMsg and CryptoJWT that will crop up in OidcOP. |
Can you share the test that make this exception? |
Ok I looked some more into it and it seems that the bug is elsewhere. I try to run a regular code flow. When I try to exchange the authorization code with an access_token the following error is raised:
The bug is cause from the token minting. In oidc-op/src/oidcop/session/grant.py Line 306 in 0f92cfb
Token without passing the token_class . The function called is oidc-op/src/oidcop/token/__init__.py Line 74 in 0f92cfb
Which expects a token_class and if it isn't present then it defaults to authorization_code . It's weird that we haven't stumble on it all this time.
|
To solve this we can have a common exception base that will be shared across the libraries, e.g.:
|
Part of this is dealt with in #99 . |
If we add OidcError to oidcmsg it will not cover CryptoJWT but I don't see that as a major problem. |
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.
I encounter a bug were the exception defined in https://github.com/IdentityPython/oidc-op/blob/master/src/oidcop/token/__init__.py#L117 was raised when I was trying to exchange an authorization code for an access token.
Perhaps we should handle all exceptions there? Or simply create an OidcopError exception from which all other exceptions will inherit and we can simply catch that?
What do you think?
Closes #97