I am trying to utilize the PKCE in a background script of chrome extension
example shows the following:
curl https://api.dropbox.com/oauth2/token \
-d code=<AUTHORIZATION_CODE> \
-d grant_type=authorization_code \
-d code_verifier=<CODE_VERIFIER> \
-d client_id=<APP_KEY>
my code:
var dbxParams = new URLSearchParams({
client_id: client_id,
grant_type: "authorization_code",
code: access_code,
code_verifier: code_verifier,
});
var url = "https://api.dropbox.com/oauth2/token";
fetch(url, {
method: 'POST',
body: dbxParams
})
.then(function(response){
return response.json()
})
.then(function (data) {
console.log('Request succeeded with JSON response', data);
})
.catch(function (error) {
console.log('Request failed', error);
});
i always get the same reply:
{"error_description": "No auth function available for given request", "error": "invalid_request"}
can you help?