Skip to content

Commit 9efb439

Browse files
Use WebEncoders.Base64UrlEncode()
Use WebEncoders.Base64UrlEncode() instead of Base64UrlTextEncoder.Encode().
1 parent c39cb66 commit 9efb439

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

src/AspNet.Security.OAuth.Alipay/AlipayAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
221221
if (Options.UsePkce)
222222
{
223223
byte[] bytes = RandomNumberGenerator.GetBytes(32);
224-
string codeVerifier = Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder.Encode(bytes);
224+
string codeVerifier = WebEncoders.Base64UrlEncode(bytes);
225225

226226
// Store this for use during the code redemption.
227227
properties.Items.Add(OAuthConstants.CodeVerifierKey, codeVerifier);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
102102
if (Options.UsePkce)
103103
{
104104
byte[] bytes = RandomNumberGenerator.GetBytes(32);
105-
string codeVerifier = Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder.Encode(bytes);
105+
string codeVerifier = WebEncoders.Base64UrlEncode(bytes);
106106

107107
// Store this for use during the code redemption.
108108
properties.Items.Add(OAuthConstants.CodeVerifierKey, codeVerifier);

src/AspNet.Security.OAuth.Mixcloud/MixcloudAuthenticationHandler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using Microsoft.AspNetCore.WebUtilities;
1414
using Microsoft.Extensions.Logging;
1515
using Microsoft.Extensions.Options;
16-
using Base64UrlTextEncoder = Microsoft.AspNetCore.Authentication.Base64UrlTextEncoder;
1716

1817
namespace AspNet.Security.OAuth.Mixcloud;
1918

@@ -43,7 +42,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
4342
if (Options.UsePkce)
4443
{
4544
var bytes = RandomNumberGenerator.GetBytes(32);
46-
var codeVerifier = Base64UrlTextEncoder.Encode(bytes);
45+
var codeVerifier = WebEncoders.Base64UrlEncode(bytes);
4746

4847
// Store this for use during the code redemption.
4948
properties.Items.Add(OAuthConstants.CodeVerifierKey, codeVerifier);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
119119
if (Options.UsePkce)
120120
{
121121
byte[] bytes = RandomNumberGenerator.GetBytes(32);
122-
string codeVerifier = Microsoft.AspNetCore.WebUtilities.Base64UrlTextEncoder.Encode(bytes);
122+
string codeVerifier = WebEncoders.Base64UrlEncode(bytes);
123123

124124
// Store this for use during the code redemption.
125125
properties.Items.Add(OAuthConstants.CodeVerifierKey, codeVerifier);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
139139
if (Options.UsePkce)
140140
{
141141
var bytes = RandomNumberGenerator.GetBytes(32);
142-
var codeVerifier = Microsoft.AspNetCore.Authentication.Base64UrlTextEncoder.Encode(bytes);
142+
var codeVerifier = WebEncoders.Base64UrlEncode(bytes);
143143

144144
// Store this for use during the code redemption.
145145
properties.Items.Add(OAuthConstants.CodeVerifierKey, codeVerifier);

src/AspNet.Security.OAuth.WorkWeixin/WorkWeixinAuthenticationHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected override string BuildChallengeUrl([NotNull] AuthenticationProperties p
112112
if (Options.UsePkce)
113113
{
114114
var bytes = RandomNumberGenerator.GetBytes(32);
115-
var codeVerifier = Microsoft.AspNetCore.Authentication.Base64UrlTextEncoder.Encode(bytes);
115+
var codeVerifier = WebEncoders.Base64UrlEncode(bytes);
116116

117117
// Store this for use during the code redemption.
118118
properties.Items.Add(OAuthConstants.CodeVerifierKey, codeVerifier);

0 commit comments

Comments
 (0)