To make integrations with eBay RESTful APIs easier, eBay provides client libraries in C# and Java to make it simpler to set up authorization, reduce the amount of code the application developers have to write to get OAuth Access Tokens. This library in addition to functioning as a simple eBay OAuth Client, helps with additional features such as cached App tokens.
OAuth 2.0 is the industry-standard protocol for authorization to obtain limited access to an HTTP service. All eBay RESTful APIs use the OAuth 2.0 protocol for authorization. OAuth access tokens verify to eBay that a request is coming from a valid client and that the application has the user’s authorization to carry out the requests. Learn more about the OAuth Access Tokens.
eBay OAuth Client is a class library that targets the .NET Standard 2.0. This library can be used by any .NET implementation that supports 2.0 version of the .NET Standard.
Current Version : 2.0.3
Use of this source code is governed by Apache-2.0 license.If you’re looking for the latest stable version (2.0.3), you can grab it directly from NuGet.org.
https://www.nuget.org/packages/eBay.OAuth.Client
In Solution Explorer, right-click NuGet in .csproj and choose Add Package.
Search for eBay.OAuth.Client, select that package in the list, and click on Add Package
Accept the License prompt
Install-Package eBay.OAuth.Client -Version 2.0.3
<ItemGroup>
<PackageReference Include="eBay.OAuth.Client" Version="2.0.3" />
</ItemGroup>
dotnet add package eBay.OAuth.Client --version 2.0.3
<ItemGroup>
<PackageReference Include="eBay.OAuth.Client" Version="2.0.3" />
</ItemGroup>
paket add eBay.OAuth.Client --version 2.0.3
<ItemGroup>
<PackageReference Include="eBay.OAuth.Client" Version="2.0.3" />
</ItemGroup>
name: ebay-config
api.sandbox.ebay.com:
appid: <appid-from-developer-portal>
certid: <certid-from-developer-portal>
devid: <devid-from-developer-portal>
redirecturi: <redirect_uri-from-developer-portal>
api.ebay.com:
appid: <appid-from-developer-portal>
certid: <certid-from-developer-portal>
devid: <devid-from-developer-portal>
redirecturi: <redirect_uri-from-developer-portal>
CredentialUtil.Load(“YAML config file path”);
or
CredentialUtil.Load(System.IO.StreamReader);
Once the credentials are loaded, call any operation on OAuth2Api.
OAuth2Api.GetApplicationToken(OAuthEnvironment environment, IList<String> scopes)
OAuth2Api.GenerateUserAuthorizationUrl(OAuthEnvironment environment, IList<String> scopes, String state)
OAuth2Api.ExchangeCodeForAccessToken(OAuthEnvironment environment, String code)
OAuth2Api.GetAccessToken(OAuthEnvironment environment, String refreshToken, IList<String> scopes)
Contributions in terms of patches, features, or comments are always welcome. Refer to CONTRIBUTING for guidelines. Submit Github issues for any feature enhancements, bugs, or documentation problems as well as questions and comments.
Copyright (c) 2018-2019 eBay Inc.
Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file or at https://opensource.org/licenses/Apache-2.0.