-
Notifications
You must be signed in to change notification settings - Fork 58
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
"ValueError: Unable to parse claims from response" on get() #898
Comments
Hello @zhetao1116 thanks for using the SDK and for raising this. This error occurs when you have an invalid or expired token. You can get a valid token using Auth flow of your choice, check the samples here, under authentication samples: https://github.com/microsoftgraph/msgraph-sdk-python/tree/main/docs You can also build your own way of getting the token following https://learn.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python |
HI @shemogumbe ! Thanks for reply.
Yeah, but we want to know this type of error as we expect the sdk client to return InvalidTokenException instead of the unrelated ValueError: Unable to parse claims from response. How could we get that? |
bump up |
+1 for @zhetao1116 . I am in the same situation with you, using the access token directly. I also expect more specific exception than ValueError to be raised when the token in expired. |
any official solution here? @shemogumbe |
Describe the bug
I am facing the same issue although I am invoking the public API and it happens when the token is invalid or expired.
My code for Graph Client. I initialize it with OAuth token directly.
Any idea how could I fix it to get the error response?
A similar issue thread which has the exactly same error which hasn't been fully resolved:
#672
The response from MSFT:
Expected behavior
The ODataError/APIError exception should be raised.
How to reproduce
Invoke a public API with an invalid/expired oauth token.
SDK Version
1.1.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```The text was updated successfully, but these errors were encountered: