diff --git a/Directory.Packages.props b/Directory.Packages.props
index 44ea9ebc6..c2dca6cfa 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -4,16 +4,16 @@
-
-
-
-
+
+
+
+
-
+
-
+
diff --git a/eng/Versions.props b/eng/Versions.props
index 66644c088..aa505ed23 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -1,13 +1,17 @@
- 3
- 1
- 4
+ 5
+ 0
+ 0
$(MajorVersion).$(MinorVersion).$(PatchVersion)
- preview
+ rc
+ 1
+ RC $(PreReleaseVersionIteration)
false
release
+ true
+ false
diff --git a/global.json b/global.json
index 9ce57d61f..2bf4ea268 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"tools": {
- "dotnet": "3.1.401"
+ "dotnet": "5.0.100-rc.1.20452.10"
},
"msbuild-sdks": {
diff --git a/samples/Mvc.Client/Controllers/AuthenticationController.cs b/samples/Mvc.Client/Controllers/AuthenticationController.cs
index 114775e90..69601a8d6 100644
--- a/samples/Mvc.Client/Controllers/AuthenticationController.cs
+++ b/samples/Mvc.Client/Controllers/AuthenticationController.cs
@@ -40,7 +40,7 @@ public async Task SignIn([FromForm] string provider)
[HttpGet("~/signout")]
[HttpPost("~/signout")]
- public IActionResult SignOut()
+ public override SignOutResult SignOut()
{
// Instruct the cookies middleware to delete the local cookie created
// when the user agent is redirected from the external identity provider
diff --git a/samples/Mvc.Client/Mvc.Client.csproj b/samples/Mvc.Client/Mvc.Client.csproj
index 26ae069d0..5a4e500e8 100644
--- a/samples/Mvc.Client/Mvc.Client.csproj
+++ b/samples/Mvc.Client/Mvc.Client.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
AspNet.Security.OAuth.Providers.Mvc.Client
diff --git a/src/AspNet.Security.OAuth.Amazon/AmazonAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Amazon/AmazonAuthenticationHandler.cs
index 257438106..f80ae50a9 100644
--- a/src/AspNet.Security.OAuth.Amazon/AmazonAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Amazon/AmazonAuthenticationHandler.cs
@@ -76,7 +76,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Amazon/AspNet.Security.OAuth.Amazon.csproj b/src/AspNet.Security.OAuth.Amazon/AspNet.Security.OAuth.Amazon.csproj
index cba167850..0da04e1c0 100644
--- a/src/AspNet.Security.OAuth.Amazon/AspNet.Security.OAuth.Amazon.csproj
+++ b/src/AspNet.Security.OAuth.Amazon/AspNet.Security.OAuth.Amazon.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Apple/AppleAuthenticationEvents.cs b/src/AspNet.Security.OAuth.Apple/AppleAuthenticationEvents.cs
index 574680ee3..63b57f46a 100644
--- a/src/AspNet.Security.OAuth.Apple/AppleAuthenticationEvents.cs
+++ b/src/AspNet.Security.OAuth.Apple/AppleAuthenticationEvents.cs
@@ -22,7 +22,7 @@ public class AppleAuthenticationEvents : OAuthEvents
///
public Func OnGenerateClientSecret { get; set; } = async context =>
{
- var provider = context.HttpContext.RequestServices.GetService();
+ var provider = context.HttpContext!.RequestServices!.GetRequiredService();
context.Options.ClientSecret = await provider.GenerateAsync(context);
};
diff --git a/src/AspNet.Security.OAuth.Apple/AppleAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Apple/AppleAuthenticationHandler.cs
index ef61e37d8..3d9c2466e 100644
--- a/src/AspNet.Security.OAuth.Apple/AppleAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Apple/AppleAuthenticationHandler.cs
@@ -80,7 +80,7 @@ protected override async Task CreateTicketAsync(
[NotNull] AuthenticationProperties properties,
[NotNull] OAuthTokenResponse tokens)
{
- string idToken = tokens.Response.RootElement.GetString("id_token");
+ string? idToken = tokens.Response.RootElement.GetString("id_token");
Logger.LogInformation("Creating ticket for Sign in with Apple.");
@@ -118,7 +118,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
///
@@ -170,13 +170,13 @@ protected virtual IEnumerable ExtractClaimsFromUser([NotNull] JsonElement
if (user.TryGetProperty("name", out var name))
{
- claims.Add(new Claim(ClaimTypes.GivenName, name.GetString("firstName"), ClaimValueTypes.String, ClaimsIssuer));
- claims.Add(new Claim(ClaimTypes.Surname, name.GetString("lastName"), ClaimValueTypes.String, ClaimsIssuer));
+ claims.Add(new Claim(ClaimTypes.GivenName, name.GetString("firstName") ?? string.Empty, ClaimValueTypes.String, ClaimsIssuer));
+ claims.Add(new Claim(ClaimTypes.Surname, name.GetString("lastName") ?? string.Empty, ClaimValueTypes.String, ClaimsIssuer));
}
if (user.TryGetProperty("email", out var email))
{
- claims.Add(new Claim(ClaimTypes.Email, email.GetString(), ClaimValueTypes.String, ClaimsIssuer));
+ claims.Add(new Claim(ClaimTypes.Email, email.GetString() ?? string.Empty, ClaimValueTypes.String, ClaimsIssuer));
}
return claims;
diff --git a/src/AspNet.Security.OAuth.Apple/AspNet.Security.OAuth.Apple.csproj b/src/AspNet.Security.OAuth.Apple/AspNet.Security.OAuth.Apple.csproj
index 73a3131cf..7e8d0e2eb 100644
--- a/src/AspNet.Security.OAuth.Apple/AspNet.Security.OAuth.Apple.csproj
+++ b/src/AspNet.Security.OAuth.Apple/AspNet.Security.OAuth.Apple.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.ArcGIS/ArcGISAuthenticationHandler.cs b/src/AspNet.Security.OAuth.ArcGIS/ArcGISAuthenticationHandler.cs
index bfde09178..09c174cf5 100644
--- a/src/AspNet.Security.OAuth.ArcGIS/ArcGISAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.ArcGIS/ArcGISAuthenticationHandler.cs
@@ -38,7 +38,7 @@ protected override async Task CreateTicketAsync(
[NotNull] OAuthTokenResponse tokens)
{
// Note: the ArcGIS API doesn't support content negotiation via headers.
- string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary
+ string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary
{
["f"] = "json",
["token"] = tokens.AccessToken
@@ -68,7 +68,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.ArcGIS/AspNet.Security.OAuth.ArcGIS.csproj b/src/AspNet.Security.OAuth.ArcGIS/AspNet.Security.OAuth.ArcGIS.csproj
index c7abb68f7..e45119ecc 100644
--- a/src/AspNet.Security.OAuth.ArcGIS/AspNet.Security.OAuth.ArcGIS.csproj
+++ b/src/AspNet.Security.OAuth.ArcGIS/AspNet.Security.OAuth.ArcGIS.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Asana/AsanaAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Asana/AsanaAuthenticationHandler.cs
index fbc910edb..0e1c47885 100644
--- a/src/AspNet.Security.OAuth.Asana/AsanaAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Asana/AsanaAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions(payload.RootElement.GetProperty("data"));
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Asana/AspNet.Security.OAuth.Asana.csproj b/src/AspNet.Security.OAuth.Asana/AspNet.Security.OAuth.Asana.csproj
index a61033ad5..442e298a9 100644
--- a/src/AspNet.Security.OAuth.Asana/AspNet.Security.OAuth.Asana.csproj
+++ b/src/AspNet.Security.OAuth.Asana/AspNet.Security.OAuth.Asana.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Autodesk/AspNet.Security.OAuth.Autodesk.csproj b/src/AspNet.Security.OAuth.Autodesk/AspNet.Security.OAuth.Autodesk.csproj
index 79d35ec6e..1255abf88 100644
--- a/src/AspNet.Security.OAuth.Autodesk/AspNet.Security.OAuth.Autodesk.csproj
+++ b/src/AspNet.Security.OAuth.Autodesk/AspNet.Security.OAuth.Autodesk.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Autodesk/AutodeskAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Autodesk/AutodeskAuthenticationHandler.cs
index 5da87c0b1..441f86f8b 100644
--- a/src/AspNet.Security.OAuth.Autodesk/AutodeskAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Autodesk/AutodeskAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Automatic/AspNet.Security.OAuth.Automatic.csproj b/src/AspNet.Security.OAuth.Automatic/AspNet.Security.OAuth.Automatic.csproj
index 1dfc0b6d4..21f636040 100644
--- a/src/AspNet.Security.OAuth.Automatic/AspNet.Security.OAuth.Automatic.csproj
+++ b/src/AspNet.Security.OAuth.Automatic/AspNet.Security.OAuth.Automatic.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Automatic/AutomaticAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Automatic/AutomaticAuthenticationHandler.cs
index d36eab2f1..1ffd9ad9c 100644
--- a/src/AspNet.Security.OAuth.Automatic/AutomaticAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Automatic/AutomaticAuthenticationHandler.cs
@@ -59,13 +59,13 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
protected override string BuildChallengeUrl([NotNull] AuthenticationProperties properties, [NotNull] string redirectUri)
{
// Note: the redirect_uri parameter is not allowed by Automatic and MUST NOT be sent.
- return QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary
+ return QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary
{
["client_id"] = Options.ClientId,
["response_type"] = "code",
diff --git a/src/AspNet.Security.OAuth.Baidu/AspNet.Security.OAuth.Baidu.csproj b/src/AspNet.Security.OAuth.Baidu/AspNet.Security.OAuth.Baidu.csproj
index 1b7dd2c27..9f20d7da2 100644
--- a/src/AspNet.Security.OAuth.Baidu/AspNet.Security.OAuth.Baidu.csproj
+++ b/src/AspNet.Security.OAuth.Baidu/AspNet.Security.OAuth.Baidu.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Baidu/BaiduAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Baidu/BaiduAuthenticationHandler.cs
index f1a69c396..d17478d9b 100644
--- a/src/AspNet.Security.OAuth.Baidu/BaiduAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Baidu/BaiduAuthenticationHandler.cs
@@ -59,7 +59,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Baidu/BaiduAuthenticationOptions.cs b/src/AspNet.Security.OAuth.Baidu/BaiduAuthenticationOptions.cs
index 0d0e741f9..cfb059d1f 100644
--- a/src/AspNet.Security.OAuth.Baidu/BaiduAuthenticationOptions.cs
+++ b/src/AspNet.Security.OAuth.Baidu/BaiduAuthenticationOptions.cs
@@ -31,7 +31,7 @@ public BaiduAuthenticationOptions()
ClaimActions.MapCustomJson(BaiduAuthenticationConstants.Claims.Portrait,
user =>
{
- string portrait = user.GetString("portrait");
+ string? portrait = user.GetString("portrait");
return string.IsNullOrWhiteSpace(portrait) ?
null :
$"https://tb.himg.baidu.com/sys/portrait/item/{WebUtility.UrlEncode(portrait)}";
diff --git a/src/AspNet.Security.OAuth.Basecamp/AspNet.Security.OAuth.Basecamp.csproj b/src/AspNet.Security.OAuth.Basecamp/AspNet.Security.OAuth.Basecamp.csproj
index 5e8c7a9a3..05015e553 100644
--- a/src/AspNet.Security.OAuth.Basecamp/AspNet.Security.OAuth.Basecamp.csproj
+++ b/src/AspNet.Security.OAuth.Basecamp/AspNet.Security.OAuth.Basecamp.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Basecamp/BasecampAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Basecamp/BasecampAuthenticationHandler.cs
index 03750ec9a..7e0761a05 100644
--- a/src/AspNet.Security.OAuth.Basecamp/BasecampAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Basecamp/BasecampAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.BattleNet/AspNet.Security.OAuth.BattleNet.csproj b/src/AspNet.Security.OAuth.BattleNet/AspNet.Security.OAuth.BattleNet.csproj
index 4f4225476..f904094bd 100644
--- a/src/AspNet.Security.OAuth.BattleNet/AspNet.Security.OAuth.BattleNet.csproj
+++ b/src/AspNet.Security.OAuth.BattleNet/AspNet.Security.OAuth.BattleNet.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.BattleNet/BattleNetAuthenticationHandler.cs b/src/AspNet.Security.OAuth.BattleNet/BattleNetAuthenticationHandler.cs
index 2c9dc1c54..5141ad063 100644
--- a/src/AspNet.Security.OAuth.BattleNet/BattleNetAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.BattleNet/BattleNetAuthenticationHandler.cs
@@ -59,7 +59,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Beam/AspNet.Security.OAuth.Beam.csproj b/src/AspNet.Security.OAuth.Beam/AspNet.Security.OAuth.Beam.csproj
index fbbd94bbf..c9dc7a6d2 100644
--- a/src/AspNet.Security.OAuth.Beam/AspNet.Security.OAuth.Beam.csproj
+++ b/src/AspNet.Security.OAuth.Beam/AspNet.Security.OAuth.Beam.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Beam/BeamAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Beam/BeamAuthenticationHandler.cs
index c81b79841..d6445bba9 100644
--- a/src/AspNet.Security.OAuth.Beam/BeamAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Beam/BeamAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Bitbucket/AspNet.Security.OAuth.Bitbucket.csproj b/src/AspNet.Security.OAuth.Bitbucket/AspNet.Security.OAuth.Bitbucket.csproj
index 2fe369c6f..954fe647f 100644
--- a/src/AspNet.Security.OAuth.Bitbucket/AspNet.Security.OAuth.Bitbucket.csproj
+++ b/src/AspNet.Security.OAuth.Bitbucket/AspNet.Security.OAuth.Bitbucket.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Bitbucket/BitbucketAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Bitbucket/BitbucketAuthenticationHandler.cs
index c1adf45b7..b0b0e6d1a 100644
--- a/src/AspNet.Security.OAuth.Bitbucket/BitbucketAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Bitbucket/BitbucketAuthenticationHandler.cs
@@ -63,19 +63,19 @@ protected override async Task CreateTicketAsync(
!identity.HasClaim(claim => claim.Type == ClaimTypes.Email) &&
Options.Scope.Contains("email"))
{
- string address = await GetEmailAsync(tokens);
+ string? address = await GetEmailAsync(tokens);
if (!string.IsNullOrEmpty(address))
{
- identity.AddClaim(new Claim(ClaimTypes.Email, address, ClaimValueTypes.String, Options.ClaimsIssuer));
+ identity.AddClaim(new Claim(ClaimTypes.Email, address!, ClaimValueTypes.String, Options.ClaimsIssuer));
}
}
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
- protected virtual async Task GetEmailAsync([NotNull] OAuthTokenResponse tokens)
+ protected virtual async Task GetEmailAsync([NotNull] OAuthTokenResponse tokens)
{
using var request = new HttpRequestMessage(HttpMethod.Get, Options.UserEmailsEndpoint);
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
diff --git a/src/AspNet.Security.OAuth.Buffer/AspNet.Security.OAuth.Buffer.csproj b/src/AspNet.Security.OAuth.Buffer/AspNet.Security.OAuth.Buffer.csproj
index dfb7f65e1..6471532ad 100644
--- a/src/AspNet.Security.OAuth.Buffer/AspNet.Security.OAuth.Buffer.csproj
+++ b/src/AspNet.Security.OAuth.Buffer/AspNet.Security.OAuth.Buffer.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Buffer/BufferAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Buffer/BufferAuthenticationHandler.cs
index 213c8c73f..8d1c8f051 100644
--- a/src/AspNet.Security.OAuth.Buffer/BufferAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Buffer/BufferAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.CiscoSpark/AspNet.Security.OAuth.CiscoSpark.csproj b/src/AspNet.Security.OAuth.CiscoSpark/AspNet.Security.OAuth.CiscoSpark.csproj
index 2b8fd2f7a..241956ea4 100644
--- a/src/AspNet.Security.OAuth.CiscoSpark/AspNet.Security.OAuth.CiscoSpark.csproj
+++ b/src/AspNet.Security.OAuth.CiscoSpark/AspNet.Security.OAuth.CiscoSpark.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.CiscoSpark/CiscoSparkAuthenticationHandler.cs b/src/AspNet.Security.OAuth.CiscoSpark/CiscoSparkAuthenticationHandler.cs
index 459d5620f..39aef57e2 100644
--- a/src/AspNet.Security.OAuth.CiscoSpark/CiscoSparkAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.CiscoSpark/CiscoSparkAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Deezer/AspNet.Security.OAuth.Deezer.csproj b/src/AspNet.Security.OAuth.Deezer/AspNet.Security.OAuth.Deezer.csproj
index 50f597073..8ee404b7b 100644
--- a/src/AspNet.Security.OAuth.Deezer/AspNet.Security.OAuth.Deezer.csproj
+++ b/src/AspNet.Security.OAuth.Deezer/AspNet.Security.OAuth.Deezer.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Deezer/DeezerAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Deezer/DeezerAuthenticationHandler.cs
index c2d0c6a25..1d00e3c7e 100644
--- a/src/AspNet.Security.OAuth.Deezer/DeezerAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Deezer/DeezerAuthenticationHandler.cs
@@ -37,7 +37,7 @@ public DeezerAuthenticationHandler(
protected override async Task ExchangeCodeAsync([NotNull] OAuthCodeExchangeContext context)
{
- var tokenRequestParameters = new Dictionary()
+ var tokenRequestParameters = new Dictionary()
{
["app_id"] = Options.ClientId,
["secret"] = Options.ClientSecret,
@@ -104,7 +104,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
protected override string BuildChallengeUrl([NotNull] AuthenticationProperties properties, [NotNull] string redirectUri)
@@ -112,7 +112,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
var scopeParameter = properties.GetParameter>(OAuthChallengeProperties.ScopeKey);
string scopes = scopeParameter != null ? FormatScope(scopeParameter) : FormatScope();
- var parameters = new Dictionary
+ var parameters = new Dictionary
{
["app_id"] = Options.ClientId,
["redirect_uri"] = redirectUri,
@@ -128,8 +128,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
// Store this for use during the code redemption.
properties.Items.Add(OAuthConstants.CodeVerifierKey, codeVerifier);
- using var sha256 = HashAlgorithm.Create("SHA256");
- byte[] challengeBytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(codeVerifier));
+ byte[] challengeBytes = SHA256.HashData(Encoding.UTF8.GetBytes(codeVerifier));
parameters[OAuthConstants.CodeChallengeKey] = WebEncoders.Base64UrlEncode(challengeBytes);
parameters[OAuthConstants.CodeChallengeMethodKey] = OAuthConstants.CodeChallengeMethodS256;
}
diff --git a/src/AspNet.Security.OAuth.DeviantArt/AspNet.Security.OAuth.DeviantArt.csproj b/src/AspNet.Security.OAuth.DeviantArt/AspNet.Security.OAuth.DeviantArt.csproj
index 05b7b6b26..13e359cd7 100644
--- a/src/AspNet.Security.OAuth.DeviantArt/AspNet.Security.OAuth.DeviantArt.csproj
+++ b/src/AspNet.Security.OAuth.DeviantArt/AspNet.Security.OAuth.DeviantArt.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.DeviantArt/DeviantArtAuthenticationHandler.cs b/src/AspNet.Security.OAuth.DeviantArt/DeviantArtAuthenticationHandler.cs
index e3c951068..6d54d8815 100644
--- a/src/AspNet.Security.OAuth.DeviantArt/DeviantArtAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.DeviantArt/DeviantArtAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Discord/AspNet.Security.OAuth.Discord.csproj b/src/AspNet.Security.OAuth.Discord/AspNet.Security.OAuth.Discord.csproj
index 09bb26d43..89c0d3c5e 100644
--- a/src/AspNet.Security.OAuth.Discord/AspNet.Security.OAuth.Discord.csproj
+++ b/src/AspNet.Security.OAuth.Discord/AspNet.Security.OAuth.Discord.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Discord/DiscordAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Discord/DiscordAuthenticationHandler.cs
index 0beb30084..0c34dd539 100644
--- a/src/AspNet.Security.OAuth.Discord/DiscordAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Discord/DiscordAuthenticationHandler.cs
@@ -74,7 +74,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Dropbox/AspNet.Security.OAuth.Dropbox.csproj b/src/AspNet.Security.OAuth.Dropbox/AspNet.Security.OAuth.Dropbox.csproj
index 01a60990c..97b54710a 100644
--- a/src/AspNet.Security.OAuth.Dropbox/AspNet.Security.OAuth.Dropbox.csproj
+++ b/src/AspNet.Security.OAuth.Dropbox/AspNet.Security.OAuth.Dropbox.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Dropbox/DropboxAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Dropbox/DropboxAuthenticationHandler.cs
index e33c14a40..a85e2fb48 100644
--- a/src/AspNet.Security.OAuth.Dropbox/DropboxAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Dropbox/DropboxAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.EVEOnline/AspNet.Security.OAuth.EVEOnline.csproj b/src/AspNet.Security.OAuth.EVEOnline/AspNet.Security.OAuth.EVEOnline.csproj
index 03b63c2c1..0fac84db3 100644
--- a/src/AspNet.Security.OAuth.EVEOnline/AspNet.Security.OAuth.EVEOnline.csproj
+++ b/src/AspNet.Security.OAuth.EVEOnline/AspNet.Security.OAuth.EVEOnline.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.EVEOnline/EVEOnlineAuthenticationHandler.cs b/src/AspNet.Security.OAuth.EVEOnline/EVEOnlineAuthenticationHandler.cs
index b6885a600..4b4309cda 100644
--- a/src/AspNet.Security.OAuth.EVEOnline/EVEOnlineAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.EVEOnline/EVEOnlineAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.ExactOnline/AspNet.Security.OAuth.ExactOnline.csproj b/src/AspNet.Security.OAuth.ExactOnline/AspNet.Security.OAuth.ExactOnline.csproj
index 94baf3fef..5013c5b26 100755
--- a/src/AspNet.Security.OAuth.ExactOnline/AspNet.Security.OAuth.ExactOnline.csproj
+++ b/src/AspNet.Security.OAuth.ExactOnline/AspNet.Security.OAuth.ExactOnline.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.ExactOnline/ExactOnlineAuthenticationHandler.cs b/src/AspNet.Security.OAuth.ExactOnline/ExactOnlineAuthenticationHandler.cs
index 19678ca2a..fc1485f38 100755
--- a/src/AspNet.Security.OAuth.ExactOnline/ExactOnlineAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.ExactOnline/ExactOnlineAuthenticationHandler.cs
@@ -64,7 +64,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions(user);
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Fitbit/AspNet.Security.OAuth.Fitbit.csproj b/src/AspNet.Security.OAuth.Fitbit/AspNet.Security.OAuth.Fitbit.csproj
index 40390f6df..e96cb71c7 100644
--- a/src/AspNet.Security.OAuth.Fitbit/AspNet.Security.OAuth.Fitbit.csproj
+++ b/src/AspNet.Security.OAuth.Fitbit/AspNet.Security.OAuth.Fitbit.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Fitbit/FitbitAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Fitbit/FitbitAuthenticationHandler.cs
index 4b74fd3a2..f6a2b93ec 100644
--- a/src/AspNet.Security.OAuth.Fitbit/FitbitAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Fitbit/FitbitAuthenticationHandler.cs
@@ -60,7 +60,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions(payload.RootElement.GetProperty("user"));
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
protected override async Task ExchangeCodeAsync([NotNull] OAuthCodeExchangeContext context)
@@ -76,7 +76,7 @@ protected override async Task ExchangeCodeAsync([NotNull] OA
["code"] = context.Code
};
- request.Content = new FormUrlEncodedContent(parameters);
+ request.Content = new FormUrlEncodedContent(parameters!);
using var response = await Backchannel.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, Context.RequestAborted);
if (!response.IsSuccessStatusCode)
diff --git a/src/AspNet.Security.OAuth.Foursquare/AspNet.Security.OAuth.Foursquare.csproj b/src/AspNet.Security.OAuth.Foursquare/AspNet.Security.OAuth.Foursquare.csproj
index cc6d4fcea..55e1a4f80 100644
--- a/src/AspNet.Security.OAuth.Foursquare/AspNet.Security.OAuth.Foursquare.csproj
+++ b/src/AspNet.Security.OAuth.Foursquare/AspNet.Security.OAuth.Foursquare.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Foursquare/FoursquareAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Foursquare/FoursquareAuthenticationHandler.cs
index 838b00848..16f3e242d 100644
--- a/src/AspNet.Security.OAuth.Foursquare/FoursquareAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Foursquare/FoursquareAuthenticationHandler.cs
@@ -37,7 +37,7 @@ protected override async Task CreateTicketAsync(
{
// See https://developer.foursquare.com/overview/versioning
// for more information about the mandatory "v" and "m" parameters.
- string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary
+ string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary
{
["m"] = "foursquare",
["v"] = !string.IsNullOrEmpty(Options.ApiVersion) ? Options.ApiVersion : FoursquareAuthenticationDefaults.ApiVersion,
@@ -73,7 +73,7 @@ protected override async Task CreateTicketAsync(
}
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.GitHub/AspNet.Security.OAuth.GitHub.csproj b/src/AspNet.Security.OAuth.GitHub/AspNet.Security.OAuth.GitHub.csproj
index edc03081a..dd607ff2e 100644
--- a/src/AspNet.Security.OAuth.GitHub/AspNet.Security.OAuth.GitHub.csproj
+++ b/src/AspNet.Security.OAuth.GitHub/AspNet.Security.OAuth.GitHub.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.GitHub/GitHubAuthenticationHandler.cs b/src/AspNet.Security.OAuth.GitHub/GitHubAuthenticationHandler.cs
index 922d54ecc..c02869ea4 100644
--- a/src/AspNet.Security.OAuth.GitHub/GitHubAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.GitHub/GitHubAuthenticationHandler.cs
@@ -63,7 +63,7 @@ protected override async Task CreateTicketAsync(
!identity.HasClaim(claim => claim.Type == ClaimTypes.Email) &&
Options.Scope.Contains("user:email"))
{
- string address = await GetEmailAsync(tokens);
+ string? address = await GetEmailAsync(tokens);
if (!string.IsNullOrEmpty(address))
{
@@ -72,10 +72,10 @@ protected override async Task CreateTicketAsync(
}
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
- protected virtual async Task GetEmailAsync([NotNull] OAuthTokenResponse tokens)
+ protected virtual async Task GetEmailAsync([NotNull] OAuthTokenResponse tokens)
{
// See https://developer.github.com/v3/users/emails/ for more information about the /user/emails endpoint.
using var request = new HttpRequestMessage(HttpMethod.Get, Options.UserEmailsEndpoint);
diff --git a/src/AspNet.Security.OAuth.GitLab/AspNet.Security.OAuth.GitLab.csproj b/src/AspNet.Security.OAuth.GitLab/AspNet.Security.OAuth.GitLab.csproj
index 0e2f1657c..78fa10d8c 100644
--- a/src/AspNet.Security.OAuth.GitLab/AspNet.Security.OAuth.GitLab.csproj
+++ b/src/AspNet.Security.OAuth.GitLab/AspNet.Security.OAuth.GitLab.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.GitLab/GitLabAuthenticationHandler.cs b/src/AspNet.Security.OAuth.GitLab/GitLabAuthenticationHandler.cs
index 2a2a416ab..84737cde8 100644
--- a/src/AspNet.Security.OAuth.GitLab/GitLabAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.GitLab/GitLabAuthenticationHandler.cs
@@ -58,7 +58,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Gitee/AspNet.Security.OAuth.Gitee.csproj b/src/AspNet.Security.OAuth.Gitee/AspNet.Security.OAuth.Gitee.csproj
index 983a27995..506b774e1 100644
--- a/src/AspNet.Security.OAuth.Gitee/AspNet.Security.OAuth.Gitee.csproj
+++ b/src/AspNet.Security.OAuth.Gitee/AspNet.Security.OAuth.Gitee.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Gitee/GiteeAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Gitee/GiteeAuthenticationHandler.cs
index b73f85c96..67f254e5b 100644
--- a/src/AspNet.Security.OAuth.Gitee/GiteeAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Gitee/GiteeAuthenticationHandler.cs
@@ -27,8 +27,8 @@ public GiteeAuthenticationHandler(
[NotNull] UrlEncoder encoder,
[NotNull] ISystemClock clock)
: base(options, logger, encoder, clock)
- {
- }
+ {
+ }
protected override async Task CreateTicketAsync(
[NotNull] ClaimsIdentity identity,
@@ -63,7 +63,7 @@ protected override async Task CreateTicketAsync(
!identity.HasClaim(claim => claim.Type == ClaimTypes.Email) &&
Options.Scope.Contains("emails"))
{
- string address = await GetEmailAsync(tokens);
+ string? address = await GetEmailAsync(tokens);
if (!string.IsNullOrEmpty(address))
{
@@ -72,10 +72,10 @@ protected override async Task CreateTicketAsync(
}
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
- protected async Task GetEmailAsync([NotNull] OAuthTokenResponse tokens)
+ protected async Task GetEmailAsync([NotNull] OAuthTokenResponse tokens)
{
using var request = new HttpRequestMessage(HttpMethod.Get, Options.UserEmailsEndpoint);
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
diff --git a/src/AspNet.Security.OAuth.Gitter/AspNet.Security.OAuth.Gitter.csproj b/src/AspNet.Security.OAuth.Gitter/AspNet.Security.OAuth.Gitter.csproj
index 39c295f51..bd6848f80 100644
--- a/src/AspNet.Security.OAuth.Gitter/AspNet.Security.OAuth.Gitter.csproj
+++ b/src/AspNet.Security.OAuth.Gitter/AspNet.Security.OAuth.Gitter.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Gitter/GitterAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Gitter/GitterAuthenticationHandler.cs
index 4eff33885..7b8f90c71 100644
--- a/src/AspNet.Security.OAuth.Gitter/GitterAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Gitter/GitterAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Harvest/AspNet.Security.OAuth.Harvest.csproj b/src/AspNet.Security.OAuth.Harvest/AspNet.Security.OAuth.Harvest.csproj
index 2805172c2..5008e9011 100644
--- a/src/AspNet.Security.OAuth.Harvest/AspNet.Security.OAuth.Harvest.csproj
+++ b/src/AspNet.Security.OAuth.Harvest/AspNet.Security.OAuth.Harvest.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Harvest/HarvestAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Harvest/HarvestAuthenticationHandler.cs
index 6f5b64faf..c67016785 100644
--- a/src/AspNet.Security.OAuth.Harvest/HarvestAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Harvest/HarvestAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.HealthGraph/AspNet.Security.OAuth.HealthGraph.csproj b/src/AspNet.Security.OAuth.HealthGraph/AspNet.Security.OAuth.HealthGraph.csproj
index d0661cee1..1309c122c 100644
--- a/src/AspNet.Security.OAuth.HealthGraph/AspNet.Security.OAuth.HealthGraph.csproj
+++ b/src/AspNet.Security.OAuth.HealthGraph/AspNet.Security.OAuth.HealthGraph.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.HealthGraph/HealthGraphAuthenticationHandler.cs b/src/AspNet.Security.OAuth.HealthGraph/HealthGraphAuthenticationHandler.cs
index 2bb41360d..91dd38c94 100644
--- a/src/AspNet.Security.OAuth.HealthGraph/HealthGraphAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.HealthGraph/HealthGraphAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Imgur/AspNet.Security.OAuth.Imgur.csproj b/src/AspNet.Security.OAuth.Imgur/AspNet.Security.OAuth.Imgur.csproj
index d40184f13..f477103c9 100644
--- a/src/AspNet.Security.OAuth.Imgur/AspNet.Security.OAuth.Imgur.csproj
+++ b/src/AspNet.Security.OAuth.Imgur/AspNet.Security.OAuth.Imgur.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Imgur/ImgurAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Imgur/ImgurAuthenticationHandler.cs
index 24ba002ef..26e638303 100644
--- a/src/AspNet.Security.OAuth.Imgur/ImgurAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Imgur/ImgurAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions(payload.RootElement.GetProperty("data"));
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Instagram/AspNet.Security.OAuth.Instagram.csproj b/src/AspNet.Security.OAuth.Instagram/AspNet.Security.OAuth.Instagram.csproj
index d46f76ecd..34af630be 100644
--- a/src/AspNet.Security.OAuth.Instagram/AspNet.Security.OAuth.Instagram.csproj
+++ b/src/AspNet.Security.OAuth.Instagram/AspNet.Security.OAuth.Instagram.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Instagram/InstagramAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Instagram/InstagramAuthenticationHandler.cs
index 400602dcf..c7672617d 100644
--- a/src/AspNet.Security.OAuth.Instagram/InstagramAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Instagram/InstagramAuthenticationHandler.cs
@@ -65,13 +65,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
- }
-
- [Obsolete("This method is no longer called and will be removed in a future version.")]
- protected virtual string ComputeSignature([NotNull] string address)
- {
- return string.Empty;
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Instagram/InstagramAuthenticationOptions.cs b/src/AspNet.Security.OAuth.Instagram/InstagramAuthenticationOptions.cs
index 222d37c66..d80f395c1 100644
--- a/src/AspNet.Security.OAuth.Instagram/InstagramAuthenticationOptions.cs
+++ b/src/AspNet.Security.OAuth.Instagram/InstagramAuthenticationOptions.cs
@@ -35,16 +35,6 @@ public InstagramAuthenticationOptions()
ClaimActions.MapJsonKey(Claims.MediaCount, "media_count");
}
- ///
- /// Gets or sets a boolean indicating whether requests to the
- /// URL specified by
- /// should be signed before being sent to the Instagram API.
- /// Enabling this option is recommended when the client application
- /// has been configured to enforce signed requests.
- ///
- [Obsolete("This property no longer has any effect and will be removed in a future version.")]
- public bool UseSignedRequests { get; set; }
-
///
/// Gets the list of list of fields and edges to retrieve from the user information endpoint.
///
diff --git a/src/AspNet.Security.OAuth.LinkedIn/AspNet.Security.OAuth.LinkedIn.csproj b/src/AspNet.Security.OAuth.LinkedIn/AspNet.Security.OAuth.LinkedIn.csproj
index e0fff487d..dc50e0532 100644
--- a/src/AspNet.Security.OAuth.LinkedIn/AspNet.Security.OAuth.LinkedIn.csproj
+++ b/src/AspNet.Security.OAuth.LinkedIn/AspNet.Security.OAuth.LinkedIn.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.LinkedIn/LinkedInAuthenticationHandler.cs b/src/AspNet.Security.OAuth.LinkedIn/LinkedInAuthenticationHandler.cs
index bb0551787..f84783407 100644
--- a/src/AspNet.Security.OAuth.LinkedIn/LinkedInAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.LinkedIn/LinkedInAuthenticationHandler.cs
@@ -81,7 +81,7 @@ protected override async Task CreateTicketAsync(
}
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
protected virtual async Task GetEmailAsync([NotNull] OAuthTokenResponse tokens)
diff --git a/src/AspNet.Security.OAuth.LinkedIn/LinkedInAuthenticationOptions.cs b/src/AspNet.Security.OAuth.LinkedIn/LinkedInAuthenticationOptions.cs
index 5fd9581e2..fda97b75d 100644
--- a/src/AspNet.Security.OAuth.LinkedIn/LinkedInAuthenticationOptions.cs
+++ b/src/AspNet.Security.OAuth.LinkedIn/LinkedInAuthenticationOptions.cs
@@ -72,7 +72,7 @@ public LinkedInAuthenticationOptions()
/// 3. Returns the first value.
///
///
- public Func, string?, string> MultiLocaleStringResolver { get; set; } = DefaultMultiLocaleStringResolver;
+ public Func, string?, string?> MultiLocaleStringResolver { get; set; } = DefaultMultiLocaleStringResolver;
///
/// Gets the MultiLocaleString value using the configured resolver.
@@ -100,7 +100,7 @@ public LinkedInAuthenticationOptions()
preferredLocaleKey = $"{preferredLocale.GetString("language")}_{preferredLocale.GetString("country")}";
}
- var preferredLocales = new Dictionary();
+ var preferredLocales = new Dictionary();
foreach (var element in propertyLocalized.EnumerateObject())
{
@@ -140,7 +140,7 @@ private static IEnumerable GetPictureUrls(JsonElement user)
continue;
}
- string pictureUrl = imageIdentifier
+ string? pictureUrl = imageIdentifier
.EnumerateArray()
.FirstOrDefault()
.GetString("identifier");
@@ -164,7 +164,7 @@ private static IEnumerable GetPictureUrls(JsonElement user)
/// The localized values with culture keys.
/// The preferred locale, if provided by LinkedIn.
/// The localized value.
- private static string DefaultMultiLocaleStringResolver(IReadOnlyDictionary localizedValues, string? preferredLocale)
+ private static string? DefaultMultiLocaleStringResolver(IReadOnlyDictionary localizedValues, string? preferredLocale)
{
if (!string.IsNullOrEmpty(preferredLocale) &&
localizedValues.TryGetValue(preferredLocale, out string? preferredLocaleValue))
diff --git a/src/AspNet.Security.OAuth.MailChimp/AspNet.Security.OAuth.MailChimp.csproj b/src/AspNet.Security.OAuth.MailChimp/AspNet.Security.OAuth.MailChimp.csproj
index 54f6bc895..49a63a60a 100644
--- a/src/AspNet.Security.OAuth.MailChimp/AspNet.Security.OAuth.MailChimp.csproj
+++ b/src/AspNet.Security.OAuth.MailChimp/AspNet.Security.OAuth.MailChimp.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.MailChimp/MailChimpAuthenticationHandler.cs b/src/AspNet.Security.OAuth.MailChimp/MailChimpAuthenticationHandler.cs
index 282dd39cf..f62adc3d5 100644
--- a/src/AspNet.Security.OAuth.MailChimp/MailChimpAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.MailChimp/MailChimpAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.MailRu/AspNet.Security.OAuth.MailRu.csproj b/src/AspNet.Security.OAuth.MailRu/AspNet.Security.OAuth.MailRu.csproj
index 976db083f..8cbc9a0a9 100644
--- a/src/AspNet.Security.OAuth.MailRu/AspNet.Security.OAuth.MailRu.csproj
+++ b/src/AspNet.Security.OAuth.MailRu/AspNet.Security.OAuth.MailRu.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.MailRu/MailRuAuthenticationHandler.cs b/src/AspNet.Security.OAuth.MailRu/MailRuAuthenticationHandler.cs
index a120c1600..f951e18ff 100644
--- a/src/AspNet.Security.OAuth.MailRu/MailRuAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.MailRu/MailRuAuthenticationHandler.cs
@@ -59,7 +59,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Myob/AspNet.Security.OAuth.Myob.csproj b/src/AspNet.Security.OAuth.Myob/AspNet.Security.OAuth.Myob.csproj
index 0cadd4a87..3b00ee4af 100644
--- a/src/AspNet.Security.OAuth.Myob/AspNet.Security.OAuth.Myob.csproj
+++ b/src/AspNet.Security.OAuth.Myob/AspNet.Security.OAuth.Myob.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Myob/MyobAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Myob/MyobAuthenticationHandler.cs
index bb6f31191..15b8606a5 100644
--- a/src/AspNet.Security.OAuth.Myob/MyobAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Myob/MyobAuthenticationHandler.cs
@@ -40,7 +40,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.NetEase/AspNet.Security.OAuth.NetEase.csproj b/src/AspNet.Security.OAuth.NetEase/AspNet.Security.OAuth.NetEase.csproj
index 7f98c12ab..447750635 100644
--- a/src/AspNet.Security.OAuth.NetEase/AspNet.Security.OAuth.NetEase.csproj
+++ b/src/AspNet.Security.OAuth.NetEase/AspNet.Security.OAuth.NetEase.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.NetEase/NetEaseAuthenticationHandler.cs b/src/AspNet.Security.OAuth.NetEase/NetEaseAuthenticationHandler.cs
index 4c91cae59..4e4b650d7 100644
--- a/src/AspNet.Security.OAuth.NetEase/NetEaseAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.NetEase/NetEaseAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Nextcloud/AspNet.Security.OAuth.Nextcloud.csproj b/src/AspNet.Security.OAuth.Nextcloud/AspNet.Security.OAuth.Nextcloud.csproj
index 823f66de7..c7bb680b8 100644
--- a/src/AspNet.Security.OAuth.Nextcloud/AspNet.Security.OAuth.Nextcloud.csproj
+++ b/src/AspNet.Security.OAuth.Nextcloud/AspNet.Security.OAuth.Nextcloud.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Nextcloud/NextcloudAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Nextcloud/NextcloudAuthenticationHandler.cs
index c46c9abee..5e15086d9 100644
--- a/src/AspNet.Security.OAuth.Nextcloud/NextcloudAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Nextcloud/NextcloudAuthenticationHandler.cs
@@ -35,7 +35,7 @@ protected override async Task CreateTicketAsync(
[NotNull] AuthenticationProperties properties,
[NotNull] OAuthTokenResponse tokens)
{
- string userId = tokens.Response.RootElement.GetString("user_id");
+ string userId = tokens.Response.RootElement.GetString("user_id") ?? string.Empty;
string userEndpoint = Options.UserInformationEndpoint.TrimEnd('/');
userEndpoint += $"/{Uri.EscapeUriString(userId)}";
@@ -62,7 +62,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Odnoklassniki/AspNet.Security.OAuth.Odnoklassniki.csproj b/src/AspNet.Security.OAuth.Odnoklassniki/AspNet.Security.OAuth.Odnoklassniki.csproj
index 9091f5f7f..f1757b370 100644
--- a/src/AspNet.Security.OAuth.Odnoklassniki/AspNet.Security.OAuth.Odnoklassniki.csproj
+++ b/src/AspNet.Security.OAuth.Odnoklassniki/AspNet.Security.OAuth.Odnoklassniki.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Odnoklassniki/OdnoklassnikiAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Odnoklassniki/OdnoklassnikiAuthenticationHandler.cs
index 51862bfe1..7adb14d7e 100644
--- a/src/AspNet.Security.OAuth.Odnoklassniki/OdnoklassnikiAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Odnoklassniki/OdnoklassnikiAuthenticationHandler.cs
@@ -4,8 +4,8 @@
* for more information concerning the license and the contributors participating to this project.
*/
+using System;
using System.Collections.Generic;
-using System.Globalization;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Security.Claims;
@@ -39,11 +39,10 @@ protected override async Task CreateTicketAsync(
[NotNull] AuthenticationProperties properties,
[NotNull] OAuthTokenResponse tokens)
{
- using var algorithm = HashAlgorithm.Create("MD5");
- string accessSecret = GetHash(algorithm, tokens.AccessToken + Options.ClientSecret);
- string sign = GetHash(algorithm, $"application_key={Options.PublicSecret}format=jsonmethod=users.getCurrentUser{accessSecret}");
+ string accessSecret = GetMD5Hash(tokens.AccessToken + Options.ClientSecret);
+ string sign = GetMD5Hash($"application_key={Options.PublicSecret}format=jsonmethod=users.getCurrentUser{accessSecret}");
- string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary
+ string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary
{
["application_key"] = Options.PublicSecret ?? string.Empty,
["format"] = "json",
@@ -74,19 +73,16 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
- private static string GetHash(HashAlgorithm algorithm, string input)
+ private static string GetMD5Hash(string input)
{
- var builder = new StringBuilder();
+#pragma warning disable CA5351
+ byte[] hash = MD5.HashData(Encoding.UTF8.GetBytes(input));
+#pragma warning restore CA5351
- foreach (byte b in algorithm.ComputeHash(Encoding.UTF8.GetBytes(input)))
- {
- builder.Append(b.ToString("x2", CultureInfo.InvariantCulture));
- }
-
- return builder.ToString();
+ return Convert.ToHexString(hash).ToLowerInvariant();
}
}
}
diff --git a/src/AspNet.Security.OAuth.Okta/AspNet.Security.OAuth.Okta.csproj b/src/AspNet.Security.OAuth.Okta/AspNet.Security.OAuth.Okta.csproj
index 5c47d5913..958314f13 100644
--- a/src/AspNet.Security.OAuth.Okta/AspNet.Security.OAuth.Okta.csproj
+++ b/src/AspNet.Security.OAuth.Okta/AspNet.Security.OAuth.Okta.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Okta/OktaAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Okta/OktaAuthenticationHandler.cs
index 0aba1f72e..f57087847 100644
--- a/src/AspNet.Security.OAuth.Okta/OktaAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Okta/OktaAuthenticationHandler.cs
@@ -70,7 +70,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Onshape/AspNet.Security.OAuth.Onshape.csproj b/src/AspNet.Security.OAuth.Onshape/AspNet.Security.OAuth.Onshape.csproj
index 6d2917068..611c080a3 100644
--- a/src/AspNet.Security.OAuth.Onshape/AspNet.Security.OAuth.Onshape.csproj
+++ b/src/AspNet.Security.OAuth.Onshape/AspNet.Security.OAuth.Onshape.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Onshape/OnshapeAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Onshape/OnshapeAuthenticationHandler.cs
index da241e5dd..b30a30e87 100644
--- a/src/AspNet.Security.OAuth.Onshape/OnshapeAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Onshape/OnshapeAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Patreon/AspNet.Security.OAuth.Patreon.csproj b/src/AspNet.Security.OAuth.Patreon/AspNet.Security.OAuth.Patreon.csproj
index 09dfc33aa..665c14e18 100644
--- a/src/AspNet.Security.OAuth.Patreon/AspNet.Security.OAuth.Patreon.csproj
+++ b/src/AspNet.Security.OAuth.Patreon/AspNet.Security.OAuth.Patreon.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Patreon/PatreonAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Patreon/PatreonAuthenticationHandler.cs
index 110469ba8..7c3406d28 100644
--- a/src/AspNet.Security.OAuth.Patreon/PatreonAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Patreon/PatreonAuthenticationHandler.cs
@@ -70,7 +70,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions(payload.RootElement.GetProperty("data"));
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Paypal/AspNet.Security.OAuth.Paypal.csproj b/src/AspNet.Security.OAuth.Paypal/AspNet.Security.OAuth.Paypal.csproj
index 893e36f6a..babb0b2fa 100644
--- a/src/AspNet.Security.OAuth.Paypal/AspNet.Security.OAuth.Paypal.csproj
+++ b/src/AspNet.Security.OAuth.Paypal/AspNet.Security.OAuth.Paypal.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Paypal/PaypalAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Paypal/PaypalAuthenticationHandler.cs
index 4ceeee753..67982ee8d 100644
--- a/src/AspNet.Security.OAuth.Paypal/PaypalAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Paypal/PaypalAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.QQ/AspNet.Security.OAuth.QQ.csproj b/src/AspNet.Security.OAuth.QQ/AspNet.Security.OAuth.QQ.csproj
index 3b02b3972..0cbfb3851 100644
--- a/src/AspNet.Security.OAuth.QQ/AspNet.Security.OAuth.QQ.csproj
+++ b/src/AspNet.Security.OAuth.QQ/AspNet.Security.OAuth.QQ.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.QQ/QQAuthenticationHandler.cs b/src/AspNet.Security.OAuth.QQ/QQAuthenticationHandler.cs
index 64b41d895..bdd444ee2 100644
--- a/src/AspNet.Security.OAuth.QQ/QQAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.QQ/QQAuthenticationHandler.cs
@@ -46,7 +46,7 @@ protected override async Task CreateTicketAsync(
identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, identifier, ClaimValueTypes.String, Options.ClaimsIssuer));
- string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary
+ string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary
{
["oauth_consumer_key"] = Options.ClientId,
["access_token"] = tokens.AccessToken,
@@ -83,12 +83,12 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
protected override async Task ExchangeCodeAsync([NotNull] OAuthCodeExchangeContext context)
{
- string address = QueryHelpers.AddQueryString(Options.TokenEndpoint, new Dictionary()
+ string address = QueryHelpers.AddQueryString(Options.TokenEndpoint, new Dictionary()
{
["client_id"] = Options.ClientId,
["client_secret"] = Options.ClientSecret,
@@ -144,7 +144,7 @@ private async Task GetUserIdentifierAsync(OAuthTokenResponse tokens)
using var payload = JsonDocument.Parse(body);
- return payload.RootElement.GetString("openid");
+ return payload.RootElement.GetString("openid") ?? string.Empty;
}
protected override string FormatScope() => string.Join(",", Options.Scope);
diff --git a/src/AspNet.Security.OAuth.Reddit/AspNet.Security.OAuth.Reddit.csproj b/src/AspNet.Security.OAuth.Reddit/AspNet.Security.OAuth.Reddit.csproj
index 92b9f4094..d51850dbf 100644
--- a/src/AspNet.Security.OAuth.Reddit/AspNet.Security.OAuth.Reddit.csproj
+++ b/src/AspNet.Security.OAuth.Reddit/AspNet.Security.OAuth.Reddit.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Reddit/RedditAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Reddit/RedditAuthenticationHandler.cs
index bbff95f56..957fbb2c7 100644
--- a/src/AspNet.Security.OAuth.Reddit/RedditAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Reddit/RedditAuthenticationHandler.cs
@@ -68,7 +68,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
protected override string BuildChallengeUrl([NotNull] AuthenticationProperties properties, [NotNull] string redirectUri)
@@ -108,7 +108,7 @@ protected override async Task ExchangeCodeAsync([NotNull] OA
["code"] = context.Code
};
- request.Content = new FormUrlEncodedContent(parameters);
+ request.Content = new FormUrlEncodedContent(parameters!);
using var response = await Backchannel.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, Context.RequestAborted);
if (!response.IsSuccessStatusCode)
diff --git a/src/AspNet.Security.OAuth.Salesforce/AspNet.Security.OAuth.Salesforce.csproj b/src/AspNet.Security.OAuth.Salesforce/AspNet.Security.OAuth.Salesforce.csproj
index 1dd2026d6..a3ff5d743 100644
--- a/src/AspNet.Security.OAuth.Salesforce/AspNet.Security.OAuth.Salesforce.csproj
+++ b/src/AspNet.Security.OAuth.Salesforce/AspNet.Security.OAuth.Salesforce.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Salesforce/SalesforceAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Salesforce/SalesforceAuthenticationHandler.cs
index 8b9e02763..16f6986a1 100644
--- a/src/AspNet.Security.OAuth.Salesforce/SalesforceAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Salesforce/SalesforceAuthenticationHandler.cs
@@ -60,7 +60,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Shopify/AspNet.Security.OAuth.Shopify.csproj b/src/AspNet.Security.OAuth.Shopify/AspNet.Security.OAuth.Shopify.csproj
index 18e0fc42b..d1a07ff5b 100644
--- a/src/AspNet.Security.OAuth.Shopify/AspNet.Security.OAuth.Shopify.csproj
+++ b/src/AspNet.Security.OAuth.Shopify/AspNet.Security.OAuth.Shopify.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Shopify/ShopifyAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Shopify/ShopifyAuthenticationHandler.cs
index 8e4b69e1a..9032fdb69 100644
--- a/src/AspNet.Security.OAuth.Shopify/ShopifyAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Shopify/ShopifyAuthenticationHandler.cs
@@ -61,7 +61,7 @@ protected override async Task CreateTicketAsync(
// In Shopify, the customer can modify the scope given to the app. Apps should verify
// that the customer is allowing the required scope.
- string actualScope = tokens.Response.RootElement.GetString("scope");
+ string actualScope = tokens.Response.RootElement.GetString("scope") ?? string.Empty;
bool isPersistent = true;
// If the request was for a "per-user" (i.e. no offline access)
@@ -75,9 +75,9 @@ protected override async Task CreateTicketAsync(
identity.AddClaim(new Claim(ClaimTypes.Expiration, expires.ToString("O", CultureInfo.InvariantCulture), ClaimValueTypes.DateTime));
}
- actualScope = tokens.Response.RootElement.GetString("associated_user_scope");
+ actualScope = tokens.Response.RootElement.GetString("associated_user_scope") ?? string.Empty;
- string userData = tokens.Response.RootElement.GetString("associated_user");
+ string userData = tokens.Response.RootElement.GetString("associated_user") ?? string.Empty;
identity.AddClaim(new Claim(ClaimTypes.UserData, userData));
}
@@ -89,7 +89,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
///
@@ -118,7 +118,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
scope = FormatScope();
}
- string url = QueryHelpers.AddQueryString(uri, new Dictionary()
+ string url = QueryHelpers.AddQueryString(uri, new Dictionary()
{
["client_id"] = Options.ClientId,
["scope"] = scope,
@@ -161,7 +161,7 @@ protected override async Task ExchangeCodeAsync([NotNull] OA
// request the token. This probably isn't necessary, but it's an easy extra verification.
var authenticationProperties = Options.StateDataFormat.Unprotect(stateValue);
- string shopNamePropertyValue = authenticationProperties.Items[ShopifyAuthenticationDefaults.ShopNameAuthenticationProperty];
+ string? shopNamePropertyValue = authenticationProperties?.Items[ShopifyAuthenticationDefaults.ShopNameAuthenticationProperty];
if (!string.Equals(shopNamePropertyValue, shopDns, StringComparison.OrdinalIgnoreCase))
{
@@ -186,7 +186,7 @@ protected override async Task ExchangeCodeAsync([NotNull] OA
["code"] = context.Code
};
- request.Content = new FormUrlEncodedContent(parameters);
+ request.Content = new FormUrlEncodedContent(parameters!);
using var response = await Backchannel.SendAsync(request, Context.RequestAborted);
diff --git a/src/AspNet.Security.OAuth.Shopify/ShopifyAuthenticationProperties.cs b/src/AspNet.Security.OAuth.Shopify/ShopifyAuthenticationProperties.cs
index 15c419630..09ab6d7fb 100644
--- a/src/AspNet.Security.OAuth.Shopify/ShopifyAuthenticationProperties.cs
+++ b/src/AspNet.Security.OAuth.Shopify/ShopifyAuthenticationProperties.cs
@@ -26,7 +26,7 @@ public class ShopifyAuthenticationProperties : AuthenticationProperties
/// installation.
///
public ShopifyAuthenticationProperties(string shopName)
- : this(shopName, null)
+ : this(shopName, new Dictionary())
{
}
@@ -38,7 +38,7 @@ public ShopifyAuthenticationProperties(string shopName)
/// installation.
///
/// Set Items values.
- public ShopifyAuthenticationProperties(string shopName, IDictionary? items)
+ public ShopifyAuthenticationProperties(string shopName, IDictionary items)
: base(items)
{
SetShopName(shopName);
diff --git a/src/AspNet.Security.OAuth.Slack/AspNet.Security.OAuth.Slack.csproj b/src/AspNet.Security.OAuth.Slack/AspNet.Security.OAuth.Slack.csproj
index 62765c31f..03b60a6eb 100644
--- a/src/AspNet.Security.OAuth.Slack/AspNet.Security.OAuth.Slack.csproj
+++ b/src/AspNet.Security.OAuth.Slack/AspNet.Security.OAuth.Slack.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Slack/SlackAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Slack/SlackAuthenticationHandler.cs
index 9e933de04..89541ade7 100644
--- a/src/AspNet.Security.OAuth.Slack/SlackAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Slack/SlackAuthenticationHandler.cs
@@ -59,7 +59,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.SoundCloud/AspNet.Security.OAuth.SoundCloud.csproj b/src/AspNet.Security.OAuth.SoundCloud/AspNet.Security.OAuth.SoundCloud.csproj
index 3658b267f..c69a8b5d9 100644
--- a/src/AspNet.Security.OAuth.SoundCloud/AspNet.Security.OAuth.SoundCloud.csproj
+++ b/src/AspNet.Security.OAuth.SoundCloud/AspNet.Security.OAuth.SoundCloud.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.SoundCloud/SoundCloudAuthenticationHandler.cs b/src/AspNet.Security.OAuth.SoundCloud/SoundCloudAuthenticationHandler.cs
index d876114fa..0dd62f2b9 100644
--- a/src/AspNet.Security.OAuth.SoundCloud/SoundCloudAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.SoundCloud/SoundCloudAuthenticationHandler.cs
@@ -59,7 +59,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Spotify/AspNet.Security.OAuth.Spotify.csproj b/src/AspNet.Security.OAuth.Spotify/AspNet.Security.OAuth.Spotify.csproj
index 92d3d34b6..adaa3fac0 100644
--- a/src/AspNet.Security.OAuth.Spotify/AspNet.Security.OAuth.Spotify.csproj
+++ b/src/AspNet.Security.OAuth.Spotify/AspNet.Security.OAuth.Spotify.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Spotify/SpotifyAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Spotify/SpotifyAuthenticationHandler.cs
index 943407d24..c7101eeba 100644
--- a/src/AspNet.Security.OAuth.Spotify/SpotifyAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Spotify/SpotifyAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.StackExchange/AspNet.Security.OAuth.StackExchange.csproj b/src/AspNet.Security.OAuth.StackExchange/AspNet.Security.OAuth.StackExchange.csproj
index 0667947c0..2149242dc 100644
--- a/src/AspNet.Security.OAuth.StackExchange/AspNet.Security.OAuth.StackExchange.csproj
+++ b/src/AspNet.Security.OAuth.StackExchange/AspNet.Security.OAuth.StackExchange.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.StackExchange/StackExchangeAuthenticationHandler.cs b/src/AspNet.Security.OAuth.StackExchange/StackExchangeAuthenticationHandler.cs
index 3130b4f23..eb3caa79e 100644
--- a/src/AspNet.Security.OAuth.StackExchange/StackExchangeAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.StackExchange/StackExchangeAuthenticationHandler.cs
@@ -46,11 +46,12 @@ protected override async Task CreateTicketAsync(
$"No site was specified for the {nameof(StackExchangeAuthenticationOptions.Site)} property of {nameof(StackExchangeAuthenticationOptions)}.");
}
- var queryArguments = new Dictionary
+ var queryArguments = new Dictionary
{
["access_token"] = tokens.AccessToken,
["site"] = Options.Site,
};
+
if (!string.IsNullOrEmpty(Options.RequestKey))
{
queryArguments["key"] = Options.RequestKey;
@@ -80,7 +81,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions(payload.RootElement.GetProperty("items").EnumerateArray().First());
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
protected override async Task ExchangeCodeAsync([NotNull] OAuthCodeExchangeContext context)
@@ -96,7 +97,7 @@ protected override async Task ExchangeCodeAsync([NotNull] OA
using var request = new HttpRequestMessage(HttpMethod.Post, Options.TokenEndpoint)
{
- Content = new FormUrlEncodedContent(parameters)
+ Content = new FormUrlEncodedContent(parameters!)
};
using var response = await Backchannel.SendAsync(request, Context.RequestAborted);
diff --git a/src/AspNet.Security.OAuth.Strava/AspNet.Security.OAuth.Strava.csproj b/src/AspNet.Security.OAuth.Strava/AspNet.Security.OAuth.Strava.csproj
index 932abbb32..cb8ff060b 100644
--- a/src/AspNet.Security.OAuth.Strava/AspNet.Security.OAuth.Strava.csproj
+++ b/src/AspNet.Security.OAuth.Strava/AspNet.Security.OAuth.Strava.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Strava/StravaAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Strava/StravaAuthenticationHandler.cs
index 92f9a3a07..de2f03d17 100644
--- a/src/AspNet.Security.OAuth.Strava/StravaAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Strava/StravaAuthenticationHandler.cs
@@ -60,7 +60,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
protected override string FormatScope() => string.Join(",", Options.Scope);
diff --git a/src/AspNet.Security.OAuth.SuperOffice/AspNet.Security.OAuth.SuperOffice.csproj b/src/AspNet.Security.OAuth.SuperOffice/AspNet.Security.OAuth.SuperOffice.csproj
index f50fdd382..300df3796 100644
--- a/src/AspNet.Security.OAuth.SuperOffice/AspNet.Security.OAuth.SuperOffice.csproj
+++ b/src/AspNet.Security.OAuth.SuperOffice/AspNet.Security.OAuth.SuperOffice.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.SuperOffice/SuperOfficeAuthenticationHandler.cs b/src/AspNet.Security.OAuth.SuperOffice/SuperOfficeAuthenticationHandler.cs
index 943e87a7c..253deb867 100644
--- a/src/AspNet.Security.OAuth.SuperOffice/SuperOfficeAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.SuperOffice/SuperOfficeAuthenticationHandler.cs
@@ -78,7 +78,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
private async Task ProcessIdTokenAndGetContactIdentifierAsync(
@@ -86,7 +86,7 @@ private async Task ProcessIdTokenAndGetContactIdentifierAsync(
[NotNull] AuthenticationProperties properties,
[NotNull] ClaimsIdentity identity)
{
- var idToken = tokens.Response.RootElement.GetString("id_token");
+ string? idToken = tokens.Response.RootElement.GetString("id_token");
if (Options.SaveTokens)
{
@@ -131,7 +131,7 @@ private async Task ProcessIdTokenAndGetContactIdentifierAsync(
/// The id_token JWT.
private static void SaveIdToken(
[NotNull] AuthenticationProperties properties,
- [NotNull] string idToken)
+ [NotNull] string? idToken)
{
if (!string.IsNullOrWhiteSpace(idToken))
{
@@ -147,7 +147,7 @@ private static void SaveIdToken(
}
private async Task ValidateAsync(
- [NotNull] string idToken,
+ [NotNull] string? idToken,
[NotNull] TokenValidationParameters validationParameters)
{
if (Options.SecurityTokenHandler == null)
diff --git a/src/AspNet.Security.OAuth.SuperOffice/SuperOfficeFunctionalRightsClaimAction.cs b/src/AspNet.Security.OAuth.SuperOffice/SuperOfficeFunctionalRightsClaimAction.cs
index a3ad04bcc..8b02fc76b 100644
--- a/src/AspNet.Security.OAuth.SuperOffice/SuperOfficeFunctionalRightsClaimAction.cs
+++ b/src/AspNet.Security.OAuth.SuperOffice/SuperOfficeFunctionalRightsClaimAction.cs
@@ -34,7 +34,7 @@ public override void Run(JsonElement userData, ClaimsIdentity identity, string i
{
foreach (var functionRight in functionRights.EnumerateArray())
{
- identity.AddClaim(new Claim(SuperOfficeAuthenticationConstants.PrincipalNames.FunctionRights, functionRight.GetString()));
+ identity.AddClaim(new Claim(SuperOfficeAuthenticationConstants.PrincipalNames.FunctionRights, functionRight.GetString() ?? string.Empty));
}
}
}
diff --git a/src/AspNet.Security.OAuth.Trakt/AspNet.Security.OAuth.Trakt.csproj b/src/AspNet.Security.OAuth.Trakt/AspNet.Security.OAuth.Trakt.csproj
index e1b772247..357d01bdf 100644
--- a/src/AspNet.Security.OAuth.Trakt/AspNet.Security.OAuth.Trakt.csproj
+++ b/src/AspNet.Security.OAuth.Trakt/AspNet.Security.OAuth.Trakt.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Trakt/TraktAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Trakt/TraktAuthenticationHandler.cs
index 2dd373f8b..52294bae1 100644
--- a/src/AspNet.Security.OAuth.Trakt/TraktAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Trakt/TraktAuthenticationHandler.cs
@@ -60,7 +60,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Twitch/AspNet.Security.OAuth.Twitch.csproj b/src/AspNet.Security.OAuth.Twitch/AspNet.Security.OAuth.Twitch.csproj
index 2b8b94ee1..eba96f077 100644
--- a/src/AspNet.Security.OAuth.Twitch/AspNet.Security.OAuth.Twitch.csproj
+++ b/src/AspNet.Security.OAuth.Twitch/AspNet.Security.OAuth.Twitch.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Twitch/TwitchAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Twitch/TwitchAuthenticationHandler.cs
index a39247511..726585677 100644
--- a/src/AspNet.Security.OAuth.Twitch/TwitchAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Twitch/TwitchAuthenticationHandler.cs
@@ -32,7 +32,7 @@ public TwitchAuthenticationHandler(
}
protected override string BuildChallengeUrl([NotNull] AuthenticationProperties properties, [NotNull] string redirectUri)
- => QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary
+ => QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary
{
["client_id"] = Options.ClientId,
["scope"] = FormatScope(),
@@ -71,7 +71,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Untappd/AspNet.Security.OAuth.Untappd.csproj b/src/AspNet.Security.OAuth.Untappd/AspNet.Security.OAuth.Untappd.csproj
index 20f075da7..b168b4a70 100644
--- a/src/AspNet.Security.OAuth.Untappd/AspNet.Security.OAuth.Untappd.csproj
+++ b/src/AspNet.Security.OAuth.Untappd/AspNet.Security.OAuth.Untappd.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Untappd/UntappdAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Untappd/UntappdAuthenticationHandler.cs
index 016dbe5f5..72329f02a 100644
--- a/src/AspNet.Security.OAuth.Untappd/UntappdAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Untappd/UntappdAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions(payload.RootElement.GetProperty("user"));
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Vimeo/AspNet.Security.OAuth.Vimeo.csproj b/src/AspNet.Security.OAuth.Vimeo/AspNet.Security.OAuth.Vimeo.csproj
index 188fedc81..95f972634 100644
--- a/src/AspNet.Security.OAuth.Vimeo/AspNet.Security.OAuth.Vimeo.csproj
+++ b/src/AspNet.Security.OAuth.Vimeo/AspNet.Security.OAuth.Vimeo.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Vimeo/VimeoAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Vimeo/VimeoAuthenticationHandler.cs
index 83f152445..c21a778e1 100644
--- a/src/AspNet.Security.OAuth.Vimeo/VimeoAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Vimeo/VimeoAuthenticationHandler.cs
@@ -57,7 +57,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.VisualStudio/AspNet.Security.OAuth.VisualStudio.csproj b/src/AspNet.Security.OAuth.VisualStudio/AspNet.Security.OAuth.VisualStudio.csproj
index 0e7ee010e..86a7e8f20 100644
--- a/src/AspNet.Security.OAuth.VisualStudio/AspNet.Security.OAuth.VisualStudio.csproj
+++ b/src/AspNet.Security.OAuth.VisualStudio/AspNet.Security.OAuth.VisualStudio.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.VisualStudio/VisualStudioAuthenticationHandler.cs b/src/AspNet.Security.OAuth.VisualStudio/VisualStudioAuthenticationHandler.cs
index 4cde9c20f..bdaa47bf0 100644
--- a/src/AspNet.Security.OAuth.VisualStudio/VisualStudioAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.VisualStudio/VisualStudioAuthenticationHandler.cs
@@ -60,7 +60,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions();
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
protected override async Task ExchangeCodeAsync([NotNull] OAuthCodeExchangeContext context)
@@ -77,7 +77,7 @@ protected override async Task ExchangeCodeAsync([NotNull] OA
["client_assertion_type"] = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
};
- request.Content = new FormUrlEncodedContent(parameters);
+ request.Content = new FormUrlEncodedContent(parameters!);
using var response = await Backchannel.SendAsync(request, Context.RequestAborted);
@@ -99,7 +99,7 @@ protected override async Task ExchangeCodeAsync([NotNull] OA
protected override string BuildChallengeUrl([NotNull] AuthenticationProperties properties, [NotNull] string redirectUri)
{
- return QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary
+ return QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary
{
["client_id"] = Options.ClientId,
["response_type"] = "Assertion",
diff --git a/src/AspNet.Security.OAuth.Vkontakte/AspNet.Security.OAuth.Vkontakte.csproj b/src/AspNet.Security.OAuth.Vkontakte/AspNet.Security.OAuth.Vkontakte.csproj
index a573f781b..221a41609 100644
--- a/src/AspNet.Security.OAuth.Vkontakte/AspNet.Security.OAuth.Vkontakte.csproj
+++ b/src/AspNet.Security.OAuth.Vkontakte/AspNet.Security.OAuth.Vkontakte.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Vkontakte/VkontakteAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Vkontakte/VkontakteAuthenticationHandler.cs
index 718394be7..2d2fe01c2 100644
--- a/src/AspNet.Security.OAuth.Vkontakte/VkontakteAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Vkontakte/VkontakteAuthenticationHandler.cs
@@ -36,7 +36,7 @@ protected override async Task CreateTicketAsync(
[NotNull] AuthenticationProperties properties,
[NotNull] OAuthTokenResponse tokens)
{
- string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary
+ string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary
{
["access_token"] = tokens.AccessToken,
["v"] = !string.IsNullOrEmpty(Options.ApiVersion) ? Options.ApiVersion : VkontakteAuthenticationDefaults.ApiVersion
@@ -71,7 +71,7 @@ protected override async Task CreateTicketAsync(
context.RunClaimActions(tokens.Response.RootElement);
await Options.Events.CreatingTicket(context);
- return new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name);
+ return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name);
}
}
}
diff --git a/src/AspNet.Security.OAuth.Weibo/AspNet.Security.OAuth.Weibo.csproj b/src/AspNet.Security.OAuth.Weibo/AspNet.Security.OAuth.Weibo.csproj
index 920025182..816fe4d58 100644
--- a/src/AspNet.Security.OAuth.Weibo/AspNet.Security.OAuth.Weibo.csproj
+++ b/src/AspNet.Security.OAuth.Weibo/AspNet.Security.OAuth.Weibo.csproj
@@ -1,7 +1,7 @@
- netcoreapp3.1
+ net5.0
diff --git a/src/AspNet.Security.OAuth.Weibo/WeiboAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Weibo/WeiboAuthenticationHandler.cs
index 666178dd2..acf565df6 100644
--- a/src/AspNet.Security.OAuth.Weibo/WeiboAuthenticationHandler.cs
+++ b/src/AspNet.Security.OAuth.Weibo/WeiboAuthenticationHandler.cs
@@ -37,7 +37,7 @@ protected override async Task CreateTicketAsync(
[NotNull] AuthenticationProperties properties,
[NotNull] OAuthTokenResponse tokens)
{
- string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary
+ string address = QueryHelpers.AddQueryString(Options.UserInformationEndpoint, new Dictionary