Skip to content

Commit 42554be

Browse files
authored
Oauth2 desktop (#255)
* Implemented OAuth2 AuthorizeAsync. * Fixed MvcOAuth2Authorizer bug preventing confidential clients from working. * Updated readme and version.
1 parent fc8a39a commit 42554be

File tree

3 files changed

+23
-26
lines changed

3 files changed

+23
-26
lines changed

ReadMe.md

+17-21
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
LINQ to Twitter is an open source 3rd party LINQ Provider (Twitter Library) for the [Twitter](https://twitter.com/) micro-blogging service. It uses standard LINQ syntax for queries and includes method calls for changes via the [Twitter API](https://dev.twitter.com/).
44

5-
> Please take the LINQ to Twitter Survey at [https://bit.ly/2Luzbpt](https://bit.ly/2Luzbpt).
6-
75
[![Standard](https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fstandard)](https://developer.twitter.com/en/docs/twitter-api)
86
[![Labs](https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Flabs)](https://developer.twitter.com/en/docs/labs)
97
[![v2](https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fv2)](https://developer.twitter.com/en/docs/twitter-api)
@@ -12,22 +10,22 @@ LINQ to Twitter is an open source 3rd party LINQ Provider (Twitter Library) for
1210

1311
The following query returns search results where people are tweeting about LINQ to Twitter:
1412
```C#
15-
var twitterCtx = new TwitterContext(...);
16-
17-
var searchResponse =
18-
await
19-
(from search in twitterCtx.Search
20-
where search.Type == SearchType.Search &&
21-
search.Query == "\"LINQ to Twitter\""
22-
select search)
23-
.SingleOrDefaultAsync();
24-
25-
if (searchResponse != null && searchResponse.Statuses != null)
26-
searchResponse.Statuses.ForEach(tweet =>
27-
Console.WriteLine(
28-
"User: {0}, Tweet: {1}",
29-
tweet.User.ScreenNameResponse,
30-
tweet.Text));
13+
var twitterCtx = new TwitterContext(...);
14+
15+
var searchResponse =
16+
await
17+
(from search in twitterCtx.Search
18+
where search.Type == SearchType.Search &&
19+
search.Query == "\"LINQ to Twitter\""
20+
select search)
21+
.SingleOrDefaultAsync();
22+
23+
if (searchResponse != null && searchResponse.Statuses != null)
24+
searchResponse.Statuses.ForEach(tweet =>
25+
Console.WriteLine(
26+
"User: {0}, Tweet: {1}",
27+
tweet.User.ScreenNameResponse,
28+
tweet.Text));
3129
```
3230
From a coding experience perspective, the `TwitterContext` type is analogous to the Entity Framework `DBContext`. You use the `TwitterContext` instance, `twitterCtx`, to access `IQueryable<T>` tweet categories. In the example above, the `Search` will give you the ability to search Twitter for tweets meeting some criteria.
3331

@@ -46,11 +44,9 @@ In addition to being able to download from this site, you can also automatically
4644

4745
## Available Feature Set
4846

49-
See [Making API Calls](https://github.com/JoeMayo/LinqToTwitter/wiki/Making-API-Calls).
47+
See [LINQ to Twitter v6 APIs]https://www.linqtotwitter.com/LINQ-to-Twitter-v6.html).
5048

5149
## For more info:
5250

5351
* follow [@JoeMayo](https://twitter.com/JoeMayo) for releases and related blog posts.
5452
* follow [@Linq2Twitr](https://twitter.com/Linq2Twitr) for more detailed project information.
55-
56-
> Please take the LINQ to Twitter Survey at [https://bit.ly/2Luzbpt](https://bit.ly/2Luzbpt).

src/LinqToTwitter6/LinqToTwitter.AspNet/LinqToTwitter.AspNet.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net5.0</TargetFramework>
5-
<Version>6.11.0</Version>
5+
<Version>6.12.0</Version>
66
<Authors>Joe Mayo</Authors>
77
<Company>Joe Mayo</Company>
88
<Product>LINQ to Twitter for ASP.NET</Product>
@@ -19,8 +19,8 @@ This library has ASP.NET authorizers and SessionStateCredentialCache that you'll
1919
<PackageReleaseNotes>
2020
Note: In previous versions of LINQ to Twitter, this was included in the `linqtotwitter` package. In version 6, ASP.NET Core 5 support is a separate package with a dependency on `linqtotwitter` v6.0+.
2121

22-
- Added OAuth 2.0 Support, including a new MvcOAuth2Authorizer and OAuth2SessionStateCredentialStore.
23-
- Fixed a bug with SessionStateCredentialStore.ClearAsync that prevented it from working.
22+
- Added default desktop support for AuthorizeAsync in OAuth2Authorizer.
23+
- Fixed bug in OAuth2Authorizer so that confidential clients now work properly.
2424
</PackageReleaseNotes>
2525
<PackageReadmeFile>ReadMe.md</PackageReadmeFile>
2626
</PropertyGroup>

src/LinqToTwitter6/LinqToTwitter/LinqToTwitter.csproj

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>net5.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<Description>LINQ to Twitter is a 3rd party LINQ Provider that lets you tweet and query with the Twitter API.</Description>
7-
<Version>6.11.0</Version>
7+
<Version>6.12.0</Version>
88
<Authors>Joe Mayo</Authors>
99
<Company>Joe Mayo</Company>
1010
<PackageId>linqtotwitter</PackageId>
@@ -17,7 +17,8 @@
1717
<RepositoryUrl>https://github.com/JoeMayo/LinqToTwitter</RepositoryUrl>
1818
<PackageTags>twitter twitterapi twitterdev tweet linq social linqtotwitter linq2twitter</PackageTags>
1919
<PackageReleaseNotes>
20-
- Added OAuth 2.0 support
20+
- Added default desktop support for AuthorizeAsync in OAuth2Authorizer.
21+
- Fixed bug in OAuth2Authorizer so that confidential clients now work properly.
2122
</PackageReleaseNotes>
2223
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
2324
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>

0 commit comments

Comments
 (0)