Skip to content

Commit 9773507

Browse files
Update to ASP.NET 5 preview 7
Update to preview 5 of ASP.NET 5.
1 parent a983366 commit 9773507

File tree

18 files changed

+29
-28
lines changed

18 files changed

+29
-28
lines changed

Directory.Packages.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<PackageVersion Include="JetBrains.Annotations" Version="2020.1.0" />
55
<PackageVersion Include="JustEat.HttpClientInterception" Version="3.0.0" />
66
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.1.0" />
7-
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="5.0.0-preview.6.*" />
8-
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Twitter" Version="5.0.0-preview.6.*" />
9-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.0-preview.6.*" />
10-
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="5.0.0-preview.6.*" />
7+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="5.0.0-preview.7.*" />
8+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Twitter" Version="5.0.0-preview.7.*" />
9+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.0-preview.7.*" />
10+
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="5.0.0-preview.7.*" />
1111
<PackageVersion Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0" />
1212
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="6.6.0" />
1313
<PackageVersion Include="Microsoft.NetCore.Analyzers" Version="3.0.0" />

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"tools": {
3-
"dotnet": "5.0.100-preview.6.20318.15"
3+
"dotnet": "5.0.100-preview.7.20366.6"
44
},
55

66
"msbuild-sdks": {

src/AspNet.Security.OAuth.Apple/AppleAuthenticationEvents.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class AppleAuthenticationEvents : OAuthEvents
2222
/// </summary>
2323
public Func<AppleGenerateClientSecretContext, Task> OnGenerateClientSecret { get; set; } = async context =>
2424
{
25-
var provider = context.HttpContext.RequestServices.GetService<AppleClientSecretGenerator>();
25+
var provider = context.HttpContext!.RequestServices!.GetRequiredService<AppleClientSecretGenerator>();
2626
context.Options.ClientSecret = await provider.GenerateAsync(context);
2727
};
2828

src/AspNet.Security.OAuth.ArcGIS/ArcGISAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3838
[NotNull] OAuthTokenResponse tokens)
3939
{
4040
// Note: the ArcGIS API doesn't support content negotiation via headers.
41-
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string>
41+
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string?>
4242
{
4343
["f"] = "json",
4444
["token"] = tokens.AccessToken

src/AspNet.Security.OAuth.Automatic/AutomaticAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
6565
protected override string BuildChallengeUrl([NotNull] AuthenticationProperties properties, [NotNull] string redirectUri)
6666
{
6767
// Note: the redirect_uri parameter is not allowed by Automatic and MUST NOT be sent.
68-
return QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary<string, string>
68+
return QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary<string, string?>
6969
{
7070
["client_id"] = Options.ClientId,
7171
["response_type"] = "code",

src/AspNet.Security.OAuth.Deezer/DeezerAuthenticationHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public DeezerAuthenticationHandler(
3737

3838
protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OAuthCodeExchangeContext context)
3939
{
40-
var tokenRequestParameters = new Dictionary<string, string>()
40+
var tokenRequestParameters = new Dictionary<string, string?>()
4141
{
4242
["app_id"] = Options.ClientId,
4343
["secret"] = Options.ClientSecret,
@@ -112,7 +112,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
112112
var scopeParameter = properties.GetParameter<ICollection<string>>(OAuthChallengeProperties.ScopeKey);
113113
string scopes = scopeParameter != null ? FormatScope(scopeParameter) : FormatScope();
114114

115-
var parameters = new Dictionary<string, string>
115+
var parameters = new Dictionary<string, string?>
116116
{
117117
["app_id"] = Options.ClientId,
118118
["redirect_uri"] = redirectUri,

src/AspNet.Security.OAuth.Foursquare/FoursquareAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3737
{
3838
// See https://developer.foursquare.com/overview/versioning
3939
// for more information about the mandatory "v" and "m" parameters.
40-
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string>
40+
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string?>
4141
{
4242
["m"] = "foursquare",
4343
["v"] = !string.IsNullOrEmpty(Options.ApiVersion) ? Options.ApiVersion : FoursquareAuthenticationDefaults.ApiVersion,

src/AspNet.Security.OAuth.Odnoklassniki/OdnoklassnikiAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
4343
string accessSecret = GetHash(algorithm!, tokens.AccessToken + Options.ClientSecret);
4444
string sign = GetHash(algorithm!, $"application_key={Options.PublicSecret}format=jsonmethod=users.getCurrentUser{accessSecret}");
4545

46-
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string>
46+
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string?>
4747
{
4848
["application_key"] = Options.PublicSecret ?? string.Empty,
4949
["format"] = "json",

src/AspNet.Security.OAuth.QQ/QQAuthenticationHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
4646

4747
identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, identifier, ClaimValueTypes.String, Options.ClaimsIssuer));
4848

49-
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string>
49+
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string?>
5050
{
5151
["oauth_consumer_key"] = Options.ClientId,
5252
["access_token"] = tokens.AccessToken,
@@ -88,7 +88,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
8888

8989
protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OAuthCodeExchangeContext context)
9090
{
91-
string address = QueryHelpers.AddQueryString(Options.TokenEndpoint, new Dictionary<string, string>()
91+
string address = QueryHelpers.AddQueryString(Options.TokenEndpoint, new Dictionary<string, string?>()
9292
{
9393
["client_id"] = Options.ClientId,
9494
["client_secret"] = Options.ClientSecret,

src/AspNet.Security.OAuth.Shopify/ShopifyAuthenticationHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
118118
scope = FormatScope();
119119
}
120120

121-
string url = QueryHelpers.AddQueryString(uri, new Dictionary<string, string>()
121+
string url = QueryHelpers.AddQueryString(uri, new Dictionary<string, string?>()
122122
{
123123
["client_id"] = Options.ClientId,
124124
["scope"] = scope,
@@ -161,7 +161,7 @@ protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OA
161161
// request the token. This probably isn't necessary, but it's an easy extra verification.
162162
var authenticationProperties = Options.StateDataFormat.Unprotect(stateValue);
163163

164-
string shopNamePropertyValue = authenticationProperties.Items[ShopifyAuthenticationDefaults.ShopNameAuthenticationProperty];
164+
string? shopNamePropertyValue = authenticationProperties.Items[ShopifyAuthenticationDefaults.ShopNameAuthenticationProperty];
165165

166166
if (!string.Equals(shopNamePropertyValue, shopDns, StringComparison.OrdinalIgnoreCase))
167167
{

src/AspNet.Security.OAuth.Shopify/ShopifyAuthenticationProperties.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class ShopifyAuthenticationProperties : AuthenticationProperties
2626
/// installation.
2727
/// </param>
2828
public ShopifyAuthenticationProperties(string shopName)
29-
: this(shopName, null)
29+
: this(shopName, new Dictionary<string, string?>())
3030
{
3131
}
3232

@@ -38,7 +38,7 @@ public ShopifyAuthenticationProperties(string shopName)
3838
/// installation.
3939
/// </param>
4040
/// <param name="items">Set Items values.</param>
41-
public ShopifyAuthenticationProperties(string shopName, IDictionary<string, string>? items)
41+
public ShopifyAuthenticationProperties(string shopName, IDictionary<string, string?> items)
4242
: base(items)
4343
{
4444
SetShopName(shopName);

src/AspNet.Security.OAuth.StackExchange/StackExchangeAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
4646
$"No site was specified for the {nameof(StackExchangeAuthenticationOptions.Site)} property of {nameof(StackExchangeAuthenticationOptions)}.");
4747
}
4848

49-
var queryArguments = new Dictionary<string, string>
49+
var queryArguments = new Dictionary<string, string?>
5050
{
5151
["access_token"] = tokens.AccessToken,
5252
["site"] = Options.Site,
5353
};
54+
5455
if (!string.IsNullOrEmpty(Options.RequestKey))
5556
{
5657
queryArguments["key"] = Options.RequestKey;

src/AspNet.Security.OAuth.Twitch/TwitchAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public TwitchAuthenticationHandler(
3232
}
3333

3434
protected override string BuildChallengeUrl([NotNull] AuthenticationProperties properties, [NotNull] string redirectUri)
35-
=> QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary<string, string>
35+
=> QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary<string, string?>
3636
{
3737
["client_id"] = Options.ClientId,
3838
["scope"] = FormatScope(),

src/AspNet.Security.OAuth.VisualStudio/VisualStudioAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OA
9999

100100
protected override string BuildChallengeUrl([NotNull] AuthenticationProperties properties, [NotNull] string redirectUri)
101101
{
102-
return QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary<string, string>
102+
return QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary<string, string?>
103103
{
104104
["client_id"] = Options.ClientId,
105105
["response_type"] = "Assertion",

src/AspNet.Security.OAuth.Vkontakte/VkontakteAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3636
[NotNull] AuthenticationProperties properties,
3737
[NotNull] OAuthTokenResponse tokens)
3838
{
39-
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string>
39+
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string?>
4040
{
4141
["access_token"] = tokens.AccessToken,
4242
["v"] = !string.IsNullOrEmpty(Options.ApiVersion) ? Options.ApiVersion : VkontakteAuthenticationDefaults.ApiVersion

src/AspNet.Security.OAuth.Weibo/WeiboAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3737
[NotNull] AuthenticationProperties properties,
3838
[NotNull] OAuthTokenResponse tokens)
3939
{
40-
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string>
40+
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string?>
4141
{
4242
["access_token"] = tokens.AccessToken,
4343
["uid"] = tokens.Response.RootElement.GetString("uid")

src/AspNet.Security.OAuth.Weixin/WeixinAuthenticationHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
5959
[NotNull] AuthenticationProperties properties,
6060
[NotNull] OAuthTokenResponse tokens)
6161
{
62-
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string>
62+
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string?>
6363
{
6464
["access_token"] = tokens.AccessToken,
6565
["openid"] = tokens.Response.RootElement.GetString("openid")
@@ -99,7 +99,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
9999

100100
protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OAuthCodeExchangeContext context)
101101
{
102-
string address = QueryHelpers.AddQueryString(Options.TokenEndpoint, new Dictionary<string, string>()
102+
string address = QueryHelpers.AddQueryString(Options.TokenEndpoint, new Dictionary<string, string?>()
103103
{
104104
["appid"] = Options.ClientId,
105105
["secret"] = Options.ClientSecret,
@@ -146,7 +146,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
146146
addRedirectHash = true;
147147
}
148148

149-
redirectUri = QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary<string, string>
149+
redirectUri = QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary<string, string?>
150150
{
151151
["appid"] = Options.ClientId,
152152
["scope"] = FormatScope(),

src/AspNet.Security.OAuth.Zalo/ZaloAuthenticationHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected override async Task<AuthenticationTicket> CreateTicketAsync(
3636
[NotNull] OAuthTokenResponse tokens)
3737
{
3838
// See https://developers.zalo.me/docs/api/social-api/tai-lieu/thong-tin-nguoi-dung-post-28
39-
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string>
39+
string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary<string, string?>
4040
{
4141
["access_token"] = tokens.AccessToken,
4242
["fields"] = "id,name,birthday,gender"
@@ -74,7 +74,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
7474

7575
protected override async Task<OAuthTokenResponse> ExchangeCodeAsync([NotNull] OAuthCodeExchangeContext context)
7676
{
77-
string address = QueryHelpers.AddQueryString(Options.TokenEndpoint, new Dictionary<string, string>
77+
string address = QueryHelpers.AddQueryString(Options.TokenEndpoint, new Dictionary<string, string?>
7878
{
7979
["app_id"] = Options.ClientId,
8080
["app_secret"] = Options.ClientSecret,

0 commit comments

Comments
 (0)