question

dz-lagertechnik_de avatar image
0 Likes"
dz-lagertechnik_de asked

OAuth Consent Request

I'm trying to follow the authorization grand flow to get a user token (and refresh token) that will last longer than 2 hours.
For development I use c# and if I have a valid user token all of my requests work fine.
Following https://developer.ebay.com/api-docs/static/oauth-consent-request.html I execute the consent request and get HTML as an response.
Then I display the response in the built in webbrowser but the capture won't load and I get a script error.

My code is here (for storing and managing credentials I use the eBay OAuth C# Client Library):
https://pastebin.com/UfSG7xY4

Can someone tell me what I do wrong?

And is there a way to get a user/refresh token that is valid for longer without having a user to login or click on something?

tokenoauthconsent flow
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.

1 Answer

· Write an Answer
sanjiv_developersupport avatar image
0 Likes"
sanjiv_developersupport answered

Hi @dz-lagertechnik_de,

Getting a user access token is a 3 step process. Please see all of the steps below:-

You need to construct an 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-

After successfully getting a user consent, you will get an 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- An 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.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.

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.