question

auerdev avatar image
0 Likes"
auerdev asked

How do I fix the invalid_client (error_description: client authentication failed) failure?

Please help me. How can I get the token. What I make false? Here my code: const axios = require('axios') const base64Encode = (encodeData) => { const buff = new Buffer.from(encodeData); return buff.toString('base64'); }; const baseUrl = ' https://api.sandbox.ebay.com'; const urlpart = '/identity/v1/oauth2/token' const clientID = 'SvenMeik-auerdeve-SBX-7f8fa419d-2b2b8245' const clientSecret = 'SBX-b44724dbea6f-ee7b-479c-be60-624c' const encodedStr = base64Encode(clientID + ':' + clientSecret); const auth = 'Basic ' + encodedStr; console.log(auth) axios.request({ baseURL: baseUrl, url: urlpart, method: 'post', auth: auth, headers: { 'accept': 'application/json', 'Content-Type':'application/x-www-form-urlencoded' }, data: { 'grant_type': 'client_credentials', 'scope': 'https%3A%2F% 2Fapi.ebay.com%2Foauth%2Fapi_scope' } }).then(res => { console.log(res); }).catch(error => { console.log(error) })
javascriptnode
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.