03-14-2024 10:42 AM
My app is just for a single user. On the User Tokens page I want to use the "Get a User Token Here" button to get an OAuth Token.
It returns the token on screen and I can click to copy the token to my clipboard and use that token in my requests. But I cannot find the refresh token which I will need to refresh this token later. Is that returned to the page somewhere?
Solved! Go to Best Answer
03-14-2024 11:58 AM
That screen returns only two-hour tokens. You will need to programmatically fetch the token to get the refresh token.
https://developer.ebay.com/my/auth?env=production&index=0&auth_type=oauth
Developer - OAuth 2 hour token
Scroll further down the screen and set up the Sign-In settings. You can use eBay defaults for the fields that hold them. Click the button to test the sign-in.
Or, you can have your server launch the Sign-in request.
https://developer.ebay.com/api-docs/static/oauth-consent-request.html
Accept the request, which will redirect to a "success" page. eBay will have appended your user's 5-minute authorization code as a query to the end of that "success" URL.
https://example.com/success.html?code=v%5E1.1%23i%5E1%23r%5E1...MA%3D%3D&expires_in=299
Grab that code value and use it to request an access token and refresh token.
https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html
Save the refresh token because you will use that for up to 18-months to mint a new 2-hour access token whenever needed.
https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html
03-14-2024 11:58 AM
That screen returns only two-hour tokens. You will need to programmatically fetch the token to get the refresh token.
https://developer.ebay.com/my/auth?env=production&index=0&auth_type=oauth
Developer - OAuth 2 hour token
Scroll further down the screen and set up the Sign-In settings. You can use eBay defaults for the fields that hold them. Click the button to test the sign-in.
Or, you can have your server launch the Sign-in request.
https://developer.ebay.com/api-docs/static/oauth-consent-request.html
Accept the request, which will redirect to a "success" page. eBay will have appended your user's 5-minute authorization code as a query to the end of that "success" URL.
https://example.com/success.html?code=v%5E1.1%23i%5E1%23r%5E1...MA%3D%3D&expires_in=299
Grab that code value and use it to request an access token and refresh token.
https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html
Save the refresh token because you will use that for up to 18-months to mint a new 2-hour access token whenever needed.
https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html
03-15-2024 04:36 AM
that's perfect many thanks