Skip to content

Commit e44f5d1

Browse files
committed
Changed method names to include the word "Async". Changed to .NET Standard 2.0 because of problems with lots of extra dependencies.
1 parent f357036 commit e44f5d1

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,17 @@ var config = new TinyOAuthConfig
8484
var tinyOAuth = new TinyOAuth(config);
8585

8686
// Get the request token and request token secret
87-
var requestTokenInfo = await tinyOAuth.GetRequestToken();
87+
var requestTokenInfo = await tinyOAuth.GetRequestTokenAsync();
8888

8989
// Construct the authorization url
9090
var authorizationUrl = tinyOAuth.GetAuthorizationUrl(requestTokenInfo.RequestToken);
9191

9292
// *** You will need to implement these methods yourself ***
93-
await LaunchWebBrowser(authorizationUrl); // Use Process.Start(authorizationUrl), LaunchUriAsync(new Uri(authorizationUrl)) etc...
94-
var verificationCode = await InputVerificationCode(authorizationUrl);
93+
await LaunchWebBrowserAsync(authorizationUrl); // Use Process.Start(authorizationUrl), LaunchUriAsync(new Uri(authorizationUrl)) etc...
94+
var verificationCode = await InputVerificationCodeAsync(authorizationUrl);
9595

9696
// *** Important: Do not run this code before visiting and completing the authorization url ***
97-
var accessTokenInfo = await tinyOAuth.GetAccessToken(requestTokenInfo.RequestToken, requestTokenInfo.RequestTokenSecret, verificationCode);
97+
var accessTokenInfo = await tinyOAuth.GetAccessTokenAsync(requestTokenInfo.RequestToken, requestTokenInfo.RequestTokenSecret, verificationCode);
9898
```
9999

100100
### Save tokens

TinyOAuth1/ITinyOAuth.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ namespace TinyOAuth1
66
{
77
public interface ITinyOAuth
88
{
9-
Task<AccessTokenInfo> GetAccessToken(string requestToken, string requestTokenSecret, string verifier);
9+
Task<AccessTokenInfo> GetAccessTokenAsync(string requestToken, string requestTokenSecret, string verifier);
1010
AuthenticationHeaderValue GetAuthorizationHeader(string accessToken, string accessTokenSecret, string url, HttpMethod httpMethod);
1111
string GetAuthorizationHeaderValue(string accessToken, string accessTokenSecret, string url, HttpMethod httpMethod);
1212
string GetAuthorizationUrl(string requestToken);
13-
Task<RequestTokenInfo> GetRequestToken();
13+
Task<RequestTokenInfo> GetRequestTokenAsync();
1414
}
1515
}

TinyOAuth1/TinyOAuth.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ private string GetSignature(string signatureBaseString, string consumerSecret, s
217217

218218
// 6.3.1. Consumer Requests an Access Token +
219219
// 6.3.2. Service Provider Grants an Access Token
220-
public async Task<AccessTokenInfo> GetAccessToken(string requestToken, string requestTokenSecret, string verifier)
220+
public async Task<AccessTokenInfo> GetAccessTokenAsync(string requestToken, string requestTokenSecret, string verifier)
221221
{
222222
/* 6.3.1. Consumer Requests an Access Token
223223
@@ -295,7 +295,7 @@ No additional Service Provider specific parameters are allowed when requesting a
295295
}
296296

297297
//6.1.1. Consumer Obtains a Request Token (https://oauth.net/core/1.0a/)
298-
public async Task<RequestTokenInfo> GetRequestToken()
298+
public async Task<RequestTokenInfo> GetRequestTokenAsync()
299299
{
300300
/*6.1.1. Consumer Obtains a Request Token
301301

TinyOAuth1/TinyOAuth1.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard1.3</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55

66
<PackageId>TinyOAuth1</PackageId>
77
<PackageVersion>1.0.0</PackageVersion>
@@ -10,13 +10,15 @@
1010
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
1111
<PackageReleaseNotes>First release</PackageReleaseNotes>
1212
<Copyright>Copyright 2017 © Johan Otterud. All rights reserved.</Copyright>
13-
<PackageTags>oauth 1.0a oauth1 authorization 1.0</PackageTags>
13+
<PackageTags>oauth 1.0a oauth1 authorization 1.0 authentication</PackageTags>
1414
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
15-
<Version>1.0.0</Version>
15+
<Version>1.1.0</Version>
1616
<Company />
1717
<PackageLicenseUrl>https://raw.githubusercontent.com/johot/TinyOAuth1/master/LICENSE.md</PackageLicenseUrl>
1818
<PackageProjectUrl>https://github.com/johot/TinyOAuth1</PackageProjectUrl>
1919
<RepositoryUrl></RepositoryUrl>
20+
<AssemblyVersion>1.1.0.0</AssemblyVersion>
21+
<FileVersion>1.1.0.0</FileVersion>
2022

2123
</PropertyGroup>
2224

0 commit comments

Comments
 (0)