Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix second core review
  • Loading branch information
Sébastien BIAUDET committed Jul 15, 2019
commit bdb74f1001a156396b7aeb6f8e2ab38615a66ee6
55 changes: 0 additions & 55 deletions samples/Mvc.Client/Mvc.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,61 +17,6 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="$(TwitterProviderVersion)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Amazon\AspNet.Security.OAuth.Amazon.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.ArcGIS\AspNet.Security.OAuth.ArcGIS.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Asana\AspNet.Security.OAuth.Asana.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Autodesk\AspNet.Security.OAuth.Autodesk.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Automatic\AspNet.Security.OAuth.Automatic.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Baidu\AspNet.Security.OAuth.Baidu.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.BattleNet\AspNet.Security.OAuth.BattleNet.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Beam\AspNet.Security.OAuth.Beam.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Bitbucket\AspNet.Security.OAuth.Bitbucket.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Buffer\AspNet.Security.OAuth.Buffer.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.CiscoSpark\AspNet.Security.OAuth.CiscoSpark.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.DeviantArt\AspNet.Security.OAuth.DeviantArt.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Discord\AspNet.Security.OAuth.Discord.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Dropbox\AspNet.Security.OAuth.Dropbox.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.EVEOnline\AspNet.Security.OAuth.EVEOnline.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Fitbit\AspNet.Security.OAuth.Fitbit.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Foursquare\AspNet.Security.OAuth.Foursquare.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.GitHub\AspNet.Security.OAuth.GitHub.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Gitter\AspNet.Security.OAuth.Gitter.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Harvest\AspNet.Security.OAuth.Harvest.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.HealthGraph\AspNet.Security.OAuth.HealthGraph.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Imgur\AspNet.Security.OAuth.Imgur.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Instagram\AspNet.Security.OAuth.Instagram.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.LinkedIn\AspNet.Security.OAuth.LinkedIn.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.MailChimp\AspNet.Security.OAuth.MailChimp.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.MailRu\AspNet.Security.OAuth.MailRu.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Myob\AspNet.Security.OAuth.Myob.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Odnoklassniki\AspNet.Security.OAuth.Odnoklassniki.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Onshape\AspNet.Security.OAuth.Onshape.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Patreon\AspNet.Security.OAuth.Patreon.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Paypal\AspNet.Security.OAuth.Paypal.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.QQ\AspNet.Security.OAuth.QQ.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Reddit\AspNet.Security.OAuth.Reddit.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Salesforce\AspNet.Security.OAuth.Salesforce.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Shopify\AspNet.Security.OAuth.Shopify.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Slack\AspNet.Security.OAuth.Slack.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.SoundCloud\AspNet.Security.OAuth.SoundCloud.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Spotify\AspNet.Security.OAuth.Spotify.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.StackExchange\AspNet.Security.OAuth.StackExchange.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Strava\AspNet.Security.OAuth.Strava.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Trakt\AspNet.Security.OAuth.Trakt.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Twitch\AspNet.Security.OAuth.Twitch.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Untappd\AspNet.Security.OAuth.Untappd.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Vimeo\AspNet.Security.OAuth.Vimeo.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.VisualStudio\AspNet.Security.OAuth.VisualStudio.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Vkontakte\AspNet.Security.OAuth.Vkontakte.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Weibo\AspNet.Security.OAuth.Weibo.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Weixin\AspNet.Security.OAuth.Weixin.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.WordPress\AspNet.Security.OAuth.WordPress.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Yahoo\AspNet.Security.OAuth.Yahoo.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Yammer\AspNet.Security.OAuth.Yammer.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Yandex\AspNet.Security.OAuth.Yandex.csproj" />
<ProjectReference Update="..\..\src\AspNet.Security.OAuth.Zalo\AspNet.Security.OAuth.Zalo.csproj" />
</ItemGroup>
<Target Name="AddGeneratedContentItems" BeforeTargets="AssignTargetPaths">
<ItemGroup>
<Content Include="*.p8" CopyToPublishDirectory="PreserveNewest" Exclude="$(DefaultItemExcludes)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
{
isPersistent = false;

if (Int32.TryParse(expireInValue.ToString(), out int expireIn))
if (int.TryParse(expireInValue.ToString(), NumberStyles.Integer, CultureInfo.InvariantCulture, out int expireIn))
{
DateTimeOffset expires = Clock.UtcNow.AddSeconds(expireIn);
identity.AddClaim(new Claim(ClaimTypes.Expiration, expires.ToString("O", CultureInfo.InvariantCulture), ClaimValueTypes.DateTime));
Expand Down Expand Up @@ -172,9 +172,9 @@ protected override async Task<OAuthTokenResponse> ExchangeCodeAsync(

string shopNamePropertyValue = authenticationProperties.Items[ShopifyAuthenticationDefaults.ShopNameAuthenticationProperty];

if (!shopNamePropertyValue.Equals(shopDns, StringComparison.OrdinalIgnoreCase))
if (!string.Equals(shopNamePropertyValue, shopDns, StringComparison.OrdinalIgnoreCase))
{
throw new InvalidOperationException("shop parameter is not the same who requested the token");
throw new InvalidOperationException("Received shop name does not match the shop name specified in the authentication request.");
}
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* for more information concerning the license and the contributors participating to this project.
*/

using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.OAuth;
Expand Down Expand Up @@ -58,7 +59,7 @@ public bool RequestPerUserToken
get
{
string prop = GetProperty(ShopifyAuthenticationDefaults.GrantOptionsAuthenticationProperty);
return string.Equals(prop, ShopifyAuthenticationDefaults.PerUserAuthenticationPropertyValue);
return string.Equals(prop, ShopifyAuthenticationDefaults.PerUserAuthenticationPropertyValue, StringComparison.OrdinalIgnoreCase);
}

set => SetProperty(ShopifyAuthenticationDefaults.GrantOptionsAuthenticationProperty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ private static void ConfigureApplication<TOptions>(IApplicationBuilder app, OAut
else
{
await tests.ChallengeAsync(context);

}
}));
}
Expand Down