This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Web-how to : FastAPI OAuth2 with Password returns 400 Bad Request on authorize #1639
Closed
9 tasks done
Labels
First check
Example
Here's a self-contained with my use case:
From official docs website
Description
Open the browser and call the Authorize form
/token
with tutorial user and pass, johndoe / secretBad Request 400
But I expected it to return
{"access_token": access_token, "token_type": "bearer"}
Do the same out of Swagger. Same error
I have testes out of swagger to test if problem is on swagger UI.
I have used RESTClient from Firefox. I have POSTed with JSON and form .
All times got
{"detail":"There was an error parsing the body"}
---maybe about swagger-UI---
The field client_id in Firefox 77.0.1 (64 bits) is marked as required, in red. But you can POST with no problem ( see gif)
The same field with Chrome 83.0
Environment
OS: [e.g. Linux / Windows / macOS]: Ubunu 20.04 LTS
FastAPI Version [e.g. 0.3.0]: 0.58.0
Python version: Python 3.8.2
Additional context
Authorize form fail
![fastapi-badreq400](https://user-images.githubusercontent.com/6016929/85939997-1fade600-b91a-11ea-9654-bbda742946e4.gif)
Chrome field client_id
![Captura de pantalla de 2020-06-28 08-40-41](https://user-images.githubusercontent.com/6016929/85940177-2d17a000-b91b-11ea-8a2a-a2622a2fd964.png)
![Captura de pantalla de 2020-06-28 08-42-12](https://user-images.githubusercontent.com/6016929/85940206-53d5d680-b91b-11ea-8a95-ce651ff6b2ce.png)
Firefox field client_id with required
Console output:
The text was updated successfully, but these errors were encountered: