Skip to content

Commit 87c2435

Browse files
authored
Merge pull request #35 from eBay/docFix
Added readme tag
2 parents 803a604 + 32ba250 commit 87c2435

File tree

2 files changed

+156
-70
lines changed

2 files changed

+156
-70
lines changed

README.md

Lines changed: 151 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,127 @@
1-
= eBay OAuth C# Client Library
2-
:toc:
3-
:toclevels: 4
1+
# Summary
42

5-
== Summary
6-
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.
7-
This library in addition to functioning as a simple eBay OAuth Client, helps with additional features such as cached App tokens.
3+
To make integrations with eBay RESTful APIs easier, eBay provides client
4+
libraries in C# and Java to make it simpler to set up authorization,
5+
reduce the amount of code the application developers have to write to
6+
get OAuth Access Tokens. This library in addition to functioning as a
7+
simple eBay OAuth Client, helps with additional features such as cached
8+
App tokens.
89

9-
== What is OAuth 2.0
10-
https://tools.ietf.org/html/rfc6749[OAuth 2.0] is the industry-standard protocol for authorization to obtain limited access to an HTTP service. All https://developer.ebay.com/docs[eBay RESTful APIs] use the OAuth 2.0 protocol for authorization.
11-
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 https://developer.ebay.com/api-docs/static/oauth-tokens.html[OAuth Access Tokens].
10+
# What is OAuth 2.0
1211

13-
== Supported Languages
14-
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.
12+
[OAuth 2.0](https://tools.ietf.org/html/rfc6749) is the
13+
industry-standard protocol for authorization to obtain limited access to
14+
an HTTP service. All [eBay RESTful
15+
APIs](https://developer.ebay.com/docs) use the OAuth 2.0 protocol for
16+
authorization. OAuth access tokens verify to eBay that a request is
17+
coming from a valid client and that the application has the user’s
18+
authorization to carry out the requests. Learn more about the [OAuth
19+
Access
20+
Tokens](https://developer.ebay.com/api-docs/static/oauth-tokens.html).
1521

16-
== Add the eBay.OAuth.Client NuGet Package
17-
**Current Version** : 2.0.0
22+
# Supported Languages
1823

19-
Use of this source code is governed by https://opensource.org/licenses/Apache-2.0[Apache-2.0 license].If you're looking for the latest stable version (2.0.0), you can grab it directly from NuGet.org.
20-
[source,xml]
24+
eBay OAuth Client is a class library that targets the .NET Standard 2.0.
25+
This library can be used by any .NET implementation that supports 2.0
26+
version of the .NET Standard.
27+
28+
# Add the eBay.OAuth.Client NuGet Package
29+
30+
**Current Version** : 2.0.1
31+
32+
Use of this source code is governed by [Apache-2.0
33+
license](https://opensource.org/licenses/Apache-2.0).If you’re looking
34+
for the latest stable version (2.0.1), you can grab it directly from
35+
NuGet.org.
36+
37+
``` xml
2138
https://www.nuget.org/packages/eBay.OAuth.Client
39+
```
40+
41+
## NuGet Package Manager UI
42+
43+
- In **Solution Explorer**, right-click NuGet in .csproj and choose
44+
**Add Package**.
45+
46+
- Search for **eBay.OAuth.Client**, select that package in the list, and
47+
click on **Add Package**
2248

23-
=== NuGet Package Manager UI
24-
- In *Solution Explorer*, right-click NuGet in .csproj and choose *Add Package*.
25-
- Search for *eBay.OAuth.Client*, select that package in the list, and click on *Add Package*
26-
- *Accept* the License prompt
49+
- **Accept** the License prompt
2750

28-
=== Package Manager Console
29-
- Use the following command in your project directory, to install the *eBay.OAuth.Client* package:
30-
[source,xml]
31-
Install-Package eBay.OAuth.Client -Version 2.0.0
51+
## Package Manager Console
3252

33-
- After the command completes, open the *.csproj* file to see the added reference:
34-
[source, xml]
53+
- Use the following command in your project directory, to install the
54+
**eBay.OAuth.Client** package:
55+
56+
``` xml
57+
Install-Package eBay.OAuth.Client -Version 2.0.1
58+
```
59+
60+
- After the command completes, open the **.csproj** file to see the
61+
added reference:
62+
63+
``` xml
3564
<ItemGroup>
36-
<PackageReference Include="eBay.OAuth.Client" Version="2.0.0" />
65+
<PackageReference Include="eBay.OAuth.Client" Version="2.0.1" />
3766
</ItemGroup>
67+
```
68+
69+
## .NET CLI
3870

39-
=== .NET CLI
40-
- Use the following command in your project directory, to install the *eBay.OAuth.Client* package:
41-
[source,xml]
42-
dotnet add package eBay.OAuth.Client --version 2.0.0
71+
- Use the following command in your project directory, to install the
72+
**eBay.OAuth.Client** package:
4373

44-
- After the command completes, open the *.csproj* file to see the added reference:
45-
[source,xml]
74+
``` xml
75+
dotnet add package eBay.OAuth.Client --version 2.0.1
76+
```
77+
78+
- After the command completes, open the **.csproj** file to see the
79+
added reference:
80+
81+
``` xml
4682
<ItemGroup>
47-
<PackageReference Include="eBay.OAuth.Client" Version="2.0.0" />
83+
<PackageReference Include="eBay.OAuth.Client" Version="2.0.1" />
4884
</ItemGroup>
85+
```
86+
87+
## Paket CLI
4988

50-
=== Paket CLI
51-
- Use the following command in your project directory, to install the *eBay.OAuth.Client* package:
52-
[source,xml]
53-
paket add eBay.OAuth.Client --version 2.0.0
89+
- Use the following command in your project directory, to install the
90+
**eBay.OAuth.Client** package:
5491

55-
- After the command completes, open the *.csproj* file to see the added reference:
56-
[source,xml]
92+
``` xml
93+
paket add eBay.OAuth.Client --version 2.0.1
94+
```
95+
96+
- After the command completes, open the **.csproj** file to see the
97+
added reference:
98+
99+
``` xml
57100
<ItemGroup>
58-
<PackageReference Include="eBay.OAuth.Client" Version="2.0.0" />
101+
<PackageReference Include="eBay.OAuth.Client" Version="2.0.1" />
59102
</ItemGroup>
103+
```
104+
105+
# Build eBay.OAuth.Client DLL from Source
106+
107+
- After cloning the project, you can build the package from the source
108+
by executing following script from project directory:
60109

61-
== Build eBay.OAuth.Client DLL from Source
110+
<!-- -->
62111

63-
- After cloning the project, you can build the package from the source by executing following script from project directory:
64-
[source,shell]
65-
./build.sh
112+
- **ebay-oauth-csharp-client.dll** will be created at
113+
ebay-oauth-csharp-client/bin/Debug/net6.0
66114

67-
- **ebay-oauth-csharp-client.dll** will be created at ebay-oauth-csharp-client/bin/Debug/net6.0
115+
# Use the eBay.OAuth.Client in the .NET App
68116

69-
== Use the eBay.OAuth.Client in the .NET App
70-
- Create a config http://yaml.org/[YAML] file in your application. The config file should contain your eBay applications keys:
71-
App Id, Cert Id & Dev Id. A sample config file is available at https://github.com/ebay/ebay-oauth-csharp-client/blob/master/Tests/ebay-config-sample.yaml[https://github.com/ebay/ebay-oauth-csharp-client/blob/master/Tests/ebay-config-sample.yaml]. Learn more about https://developer.ebay.com/api-docs/static/creating-edp-account.html#Register[creating application keys].
72-
[source, csharp]
117+
- Create a config [YAML](http://yaml.org/) file in your application. The
118+
config file should contain your eBay applications keys: App Id, Cert
119+
Id & Dev Id. A sample config file is available at
120+
<https://github.com/ebay/ebay-oauth-csharp-client/blob/master/Tests/ebay-config-sample.yaml>.
121+
Learn more about [creating application
122+
keys](https://developer.ebay.com/api-docs/static/creating-edp-account.html#Register).
123+
124+
``` csharp
73125
name: ebay-config
74126
api.sandbox.ebay.com:
75127
appid: <appid-from-developer-portal>
@@ -81,39 +133,70 @@ Api.ebay.com:
81133
certid: <certid-from-developer-portal>
82134
devid: <devid-from-developer-portal>
83135
redirecturi: <redirect_uri-from-developer-portal>
136+
```
137+
138+
- Once the config file is ready, use following code to load it. It is
139+
recommended to load the credentials during startup time
140+
(initialization) to prevent runtime delays.
84141

85-
- Once the config file is ready, use following code to load it. It is recommended to load the credentials during startup time (initialization) to prevent runtime delays.
86-
[source,csharp]
142+
``` csharp
87143
CredentialUtil.Load(“YAML config file path”);
88144
or
89145
CredentialUtil.Load(System.IO.StreamReader);
146+
```
90147

91148
- Once the credentials are loaded, call any operation on **OAuth2Api**.
92-
1. **GetApplicationToken**: Use this operation when the application request an access token to access their own resources,
93-
not on behalf of a user. Learn more about https://developer.ebay.com/api-docs/static/oauth-client-credentials-grant.html[Client Credentials grant flow].
94-
[source,csharp]
149+
150+
1. **GetApplicationToken**: Use this operation when the application
151+
request an access token to access their own resources, not on
152+
behalf of a user. Learn more about [Client Credentials grant
153+
flow](https://developer.ebay.com/api-docs/static/oauth-client-credentials-grant.html).
154+
155+
``` csharp
95156
OAuth2Api.GetApplicationToken(OAuthEnvironment environment, IList<String> scopes)
157+
```
158+
159+
1. **GenerateUserAuthorizationUrl**: Use this operation to get the
160+
Authorization URL to redirect the user to. Once the user
161+
authenticates and approves the consent, the callback needs to be
162+
captured by the redirect URL setup by the app.
96163

97-
2. **GenerateUserAuthorizationUrl**: Use this operation to get the Authorization URL to redirect the user to. Once the user
98-
authenticates and approves the consent, the callback needs to be captured by the redirect URL setup by the app.
99-
[source,csharp]
164+
``` csharp
100165
OAuth2Api.GenerateUserAuthorizationUrl(OAuthEnvironment environment, IList<String> scopes, String state)
166+
```
167+
168+
1. **ExchangeCodeForAccessToken**: Use this operation when an
169+
application exchanges an authorization code for an access token.
170+
After the user authenticates, approves the consent and returns to
171+
the application via the redirect URL , the application will get the
172+
authorization code from the URL and use it to request an access
173+
token. Learn more about [Authorization Code grant
174+
flow](https://developer.ebay.com/api-docs/static/oauth-authorization-code-grant.html).
101175

102-
3. **ExchangeCodeForAccessToken**: Use this operation when an application exchanges an authorization code for an access
103-
token. After the user authenticates, approves the consent and returns to the application via the redirect URL , the
104-
application will get the authorization code from the URL and use it to request an access token. Learn more about
105-
https://developer.ebay.com/api-docs/static/oauth-authorization-code-grant.html[Authorization Code grant flow].
106-
[source,csharp]
176+
``` csharp
107177
OAuth2Api.ExchangeCodeForAccessToken(OAuthEnvironment environment, String code)
178+
```
108179

109-
4. **GetAccessToken**: Usually access tokens are short lived. Use this operation to update the access token. Learn more about https://developer.ebay.com/api-docs/static/oauth-qref-auth-code-grant.html[Using a refresh token to update the access token].
110-
[source, csharp]
180+
1. **GetAccessToken**: Usually access tokens are short lived. Use this
181+
operation to update the access token. Learn more about [Using a
182+
refresh token to update the access
183+
token](https://developer.ebay.com/api-docs/static/oauth-qref-auth-code-grant.html).
184+
185+
``` csharp
111186
OAuth2Api.GetAccessToken(OAuthEnvironment environment, String refreshToken, IList<String> scopes)
187+
```
188+
189+
# Contribution
190+
191+
Contributions in terms of patches, features, or comments are always
192+
welcome. Refer to [CONTRIBUTING](CONTRIBUTING.adoc) for guidelines.
193+
Submit Github issues for any feature enhancements, bugs, or
194+
documentation problems as well as questions and comments.
112195

113-
== Contribution
114-
Contributions in terms of patches, features, or comments are always welcome. Refer to link:CONTRIBUTING.adoc[CONTRIBUTING] for guidelines. Submit Github issues for any feature enhancements, bugs, or documentation problems as well as questions and comments.
196+
# License
115197

116-
== License
117198
Copyright (c) 2018-2019 eBay Inc.
118199

119-
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.
200+
Use of this source code is governed by a Apache 2.0 license that can be
201+
found in the LICENSE file or at
202+
<https://opensource.org/licenses/Apache-2.0>.

ebay-oauth-csharp-client/ebay-oauth-csharp-client.nuspec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package >
33
<metadata>
44
<id>eBay.OAuth.Client</id>
5-
<version>2.0.0</version>
5+
<version>2.0.1</version>
66
<title>eBay OAuth C# Client</title>
77
<owners>eBay Inc.</owners>
88
<authors>Sandeep Dhiman</authors>
@@ -14,7 +14,7 @@
1414
</description>
1515
<releaseNotes>Fix of https://github.com/eBay/ebay-oauth-csharp-client/issues/2</releaseNotes>
1616
<copyright>Copyright 2018-2019 eBay Inc.</copyright>
17-
<readme>https://github.com/eBay/ebay-oauth-csharp-client/blob/master/README.md</readme>
17+
<readme>README.md</readme>
1818
<dependencies>
1919
<group targetFramework="net6.0">
2020
<dependency id="YamlDotNet" version="13.1.1" />
@@ -25,4 +25,7 @@
2525
</dependencies>
2626
<tags>eBay API OAuth</tags>
2727
</metadata>
28+
<files>
29+
<file src="..\README.md" target="" />
30+
</files>
2831
</package>

0 commit comments

Comments
 (0)