I'm trying to get the dropbox access_token, but the only response I get is "No auth function available for given request", and I don't know why. I've tried changing and adding every way that went through my mind to get the access code or at least a different error.
The code is the next:
generateAccessToken(accessCode: string){
const body = 'code=' + accessCode + '&grant_type=authorization_code&redirect_uri=' + environment.publicURL;
const httpHeaders = new HttpHeaders({
Authorization: 'Basic ' + btoa(environment.clientIdDropbox + ':' + environment.clientSecretDropbox)
});
const url = 'https://api.dropbox.com/oauth2/token'
this._http.post(url, body, {headers: httpHeaders})
.subscribe(res => {
//CODE AFTER GETTING THE CODE
});
}
I have to add that I've tried doing what I think is the exact same request on Postman and it works as intended.
UPDATE
I've seen with a sniffer that something is apparently overwriting the Basic authorization header with a Bearer authorization header.