Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.10.0
-
None
-
8
-
235f475c5 (dev)
-
Foundation Sprint 113, Foundation Sprint 114, Foundation Sprint 115, Foundation Sprint 116, Foundation Sprint 117
Description
Trying to play QtNetworkAuth with quizlet.
https://quizlet.com/api/2.0/docs/authorization-code-flow
Step 2: Request a token from our authorization server
An example HTTP request would look like:
POST /oauth/token HTTP/1.1
Host: api.quizlet.com
Authorization: Basic xxxx
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
grant_type=authorization_code&code=GENERATED_CODE
The "Authorization" custom header is needed in this step, I don't know how should I add it into current QOAuth2AuthorizationCodeFlow::requestAccessToken().
Current workaround is something like:
request.setRawHeader(QByteArray("Authorization"), QByteArray("Basic xxxx"));
after
query = QAbstractOAuthPrivate::createQuery(parameters);
request.setHeader(QNetworkRequest::ContentTypeHeader,
QStringLiteral("application/x-www-form-urlencoded"));