question

itati-shop avatar image
0 Likes"
itati-shop asked ·

Automatic User Access Token OAUTH2

652 / 5000

Übersetzungsergebnisse

Hello,
I need a user access token for the Sell API feed.
Unfortunately, only the user access token works for this function (Create-Task and FileUpload FX_Listing).
Does anyone know how to get the token automated and not access the confirmation page (Grant Application Access) needs to get a one-time access code?
I would like to perform the FileUpload via PHP. The upload function via PHP already works as soon as I have the user access token.
But I have to get this again at the latest after 2 hours.
Therefore, I would like to generate the token automatically.

Many thanks and best regards
oauth2sell apiuser tokenaccess tokenuser access token
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.

sagar_developersupport avatar image
0 Likes"
sagar_developersupport answered ·

Hi @rogaini-0,

Getting a user token is a 3 step process:

1. You need to construct a HTML request that will redirect the user to your application's Grant Application Access page for a getting user consent.

Ref: https://developer.ebay.com/api-docs/static/oauth-consent-request.html

2. After successfully getting a user consent, you will get a authorization code returned by the consent request URL. You can use this authorization code for getting a User access token.

Ref: https://developer.ebay.com/api-docs/static/oauth-auth-code-grant-request.html

3. A user access token is valid for two hours from the time it was generated. For continued access after the token expires, you must mint a new token using the associated refresh token.

Ref: https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.htmlRef: https://developer.ebay.com/api-docs/static/oauth-authorization-code-grant.html

Best regards ,
eBay Developer Support

·
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.

rogaini-0 avatar image
0 Likes"
rogaini-0 answered ·

Moin.

Since you say: "But I have to get this again at the latest after 2 hours."

I think, that what you need: https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html

I find help with another issues with redirects here: https://developer.ebay.com/api-docs/static/oauth-consent-request.html

I do open page for consent request:

https://auth.sandbox.ebay.com/oauth2/authorize?client_id=<app-client-id-value>&redirect_uri=<app-RuName-value>&response_type=code&scope=<scopeList>

Issue 1: eBay do not redirect to my Grant Application Access. Just eBay login page, and after login complete success page with message "...you can close that tab..".

Issue 2 (big problem for me): eBay do not redirect back to my Application page.

Details:

My app is .NET Blazor server.

I try that:

@inject IJSRuntime jsRuntime

<button id="join" @onclick="GetConsent">Getting user consent</button>

private async Task GetConsent()

{

await jsRuntime.InvokeAsync<object>("open", URLstring, "_blank");

//URLstring is https://auth.sandbox.ebay.com/oauth2/...etc

}

And i try that:

<a href="@URLstring " class="button"><button class="pixel">Getting user consent</button></a>

thx..

·
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.

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.