hendt / ebay-api

eBay Node API in TypeScript for Node and Browser with RESTful and Traditional APIs. This library aims to implement all available eBay apis.
https://hendt.gitbook.io/ebay-api
MIT License
153 stars 41 forks source link

Call to `/oauth2/token` should allow a `redirect_uri` to be passed as a urlencoded key #161

Closed thecherrie closed 10 months ago

thecherrie commented 10 months ago

Describe the bug

The internal call to https://api.sandbox.ebay.com/identity/v1/oauth2/token should allow the redirect_uri to be passed in. Currently the error when I call .getToken() is:

    data: {
      error: 'invalid_request',
      error_description: 'request is missing a required parameter or malformed.'
    }

Code

    const token = await ebayClient.OAuth2.getToken(code);
    ebayClient.OAuth2.setCredentials(token);
    // store this token e.g. to a session
    req.session.token = token

Output

    data: {
      error: 'invalid_request',
      error_description: 'request is missing a required parameter or malformed.'
    }

expected data

Would you like to work on this issue?

thecherrie commented 10 months ago

OK, found it, it's passed as the ruName? 2nd optional parameter in the getToken() function -- semantics had me confused.