Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Store state in redirectUri when authorizing Wechat Web pages to preve…
…nt "too long state parameters" error and Add the #wechat redirect parameter
  • Loading branch information
saber-wang committed May 15, 2019
commit de500696c80bb0bcc0ce1bd61386479b23323d5c
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ protected override string BuildChallengeUrl(AuthenticationProperties properties,
var oauthstate = Options.StateDataFormat.Protect(properties);
if (Options.AuthorizationEndpoint != WeixinAuthenticationDefaults.AuthorizationEndpoint)
{
//微信网页授权时将state存放到redirectUri中,防止"state参数过长"错误
//Store state in redirectUri when authorizing Wechat Web pages to prevent "too long state parameters" error
redirectUri = redirectUri.Contains("?") ? $"{redirectUri}&{nameof(oauthstate)}={oauthstate}" : $"{redirectUri}?{nameof(oauthstate)}={oauthstate}";
oauthstate = "#wechat_redirect";//微信网页授权支持
oauthstate = "#wechat_redirect";//The Parameters Necessary for Web Authorization of Wechat
}
return QueryHelpers.AddQueryString(Options.AuthorizationEndpoint, new Dictionary<string, string>
{
Expand Down