Replies: 4 comments
-
|
First step is to check the logs on your application, what does it log when you get a 500? |
Beta Was this translation helpful? Give feedback.
-
|
Sorry for the delay. I reproduced this auth bug on the Swagger UI ( API functional logsDescriptionWhen we do Authorize > Logout > Authorize on the Swagger UI we get a "Auth error 500" response instead of a 400 for Bad Request (in the case of inavalid credentials in request body) or a 401 for Unauthorized. |
Beta Was this translation helpful? Give feedback.
-
|
Which of the packages in the "authentication chain" has the responsibility of raising HTTP errors ? To the controller, route or whatever. So that the client gets a 400 or 401 response instead of a 500 for an unhandled internal error. I believe these Runtime Errors need to simply be wrapped up in a try/catch block and an HTTP error should be raised instead. They do raise HTTP errors for authentication in https://github.com/dudil/fastapi_msal, so it seems to be their responsibility in the "auth chain", no? They have this Issue: And this PR with a fix by yaokaibb that was sadly closed, not merged : Me and yaokaibb think alike lol. |
Beta Was this translation helpful? Give feedback.
-
|
Let's close this for now to keep the discussions clean and organized. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Hello everyone,
When I log in using the Authorization Form, it works perfectly. If I wait until the token's expiration date, I just need to log out and then authorize again to get a new token.
BUT if i Authenticate > Logout > Authenticate in less than a minute, I receive a 500 Internal Server Error.
I have two questions:
My app works in an Azure Cloud environment. My token is an OAuth2 configuration.
Thanks in advance for your help
Jilvo
Operating System
Linux, Windows
Operating System Details
No response
FastAPI Version
0.95.0
Pydantic Version
1.10.7
Python Version
Python 3.10.9
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions