Closed Kh-Oleg closed 1 year ago
There is something strange in the stack trace:
httpx.UnsupportedProtocol: Request URL has an unsupported protocol 'localhost://'.
Are you sure you set the Fief URL correctly on the client?
The bug seems to be gone after rebuilding docker images. Sorry for disturbance.
A follow-up remark: I was indeed initializing FiefClient incorrectly: fief = FiefAsync('localhost:8001', client_id, client_secret)
instead of fief = FiefAsync('http://localhost:8001', client_id, client_secret)
, my bad.
However, since FiefAsync requires protocol to be explicitly specified, it would be nice, if FiefAsync would raise an exception immediately, when constructing the object.
Describe the bug
When I access REST API with the access token, provided by Fief, the service responds with 500 Internal Server Error from the token validation functions.
To Reproduce
You need to setup some sample service, using Fief as Identity provider. In my case Fief runs at http://localhost:8001, my service runs at http://localhost:8000.
Expected behavior
Token validation functions shall not raise exceptions in case of a valid token.
Configuration
Additional context
Stack trace:
I also noticed a non-expected thing in the decoded access token - the 'iss' field contains https://localhost:8001, while I run Fief at http://localhost:8001.
Since I initialize FiefClient with http://localhost:8001, perhaps, it cannot match Base URLs from the Python code and from the token.