dotor3382 avatar image
dotor3382 asked

How to integrate "Sign in with Ebay" (OAuth) in React.js?

I was able to authenticate a user by going manually in the browser to:${ebayClientId}&redirect_uri=${redirectURIName}&response_type=code

And in my web server I defined a callback like so:

public authCallback(@Req() req: Request) {
const redirectURIName = this.configService.get(ConfigKeys.ebayRuName)
const ebayClientId = this.configService.get(ConfigKeys.ebayAppId)
const ebaySecretId = this.configService.get(ConfigKeys.ebayCertId)
axios('', {
method: 'post',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
        'Basic ' +
data: stringify({
grant_type: 'authorization_code',
// parsed from redirect URI after returning from eBay,
code: req.query.code,
// this is set in your dev account, also called RuName

redirect_uri: redirectURIName
.then(response => console.log(response))
.catch(err => console.log(err))

But now I try to do this flow in my React app. How can I add a button that will redirect to ebay sign in screen?

I searched for the API docs, the web for this topic, even examples, but with no luck.

For example authentication with google/facebook is done using a library that opens an iframe and returns the user_id once the user signed in. All without backend included. later with that user_id I can authenticate the user in the backend.

How can I achieve something like this with Ebay OAuth?

oauth2javascriptsign inreact
· 3
10 |600

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

michab2003 avatar image michab2003 commented ·
oauth is a very general concept and a ebay specific thing, you probably will find more answers in any react forum than here, because it's not an ebay question, it's a programming language one.
0 Likes 0 ·
dotor3382 avatar image dotor3382 michab2003 commented ·

I just don't get how other websites integrate sign in with ebay in their client side. There are no resources for this at all

0 Likes 0 ·
michab2003 avatar image michab2003 dotor3382 commented ·

the url for your button can be found here. and u get a lot of info here as well.

0 Likes 0 ·

0 Answers


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.