-
Notifications
You must be signed in to change notification settings - Fork 551
Increase support for authorization of Wechat Webpage #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @saber-wang, thanks for your PR. Could you explain what this PR is trying to achieving in English from a functional perspective please? Unfortunately the maintainers here do not speak Cantonese/Mandarin, so the PR description and code comment do not help explain. |
…nt "too long state parameters" error and Add the #wechat redirect parameter
|
Resolve the problem of state up to 128 bytes in the authorization of Web pages on the Wechat client (authorization address https://open.weixin.qq.com/connect/oauth2/authorize), and add the necessary “# wechat_redirect” parameter,Look at #266 |
src/AspNet.Security.OAuth.Weixin/WeixinAuthenticationHandler.cs
Outdated
Show resolved
Hide resolved
src/AspNet.Security.OAuth.Weixin/WeixinAuthenticationHandler.cs
Outdated
Show resolved
Hide resolved
src/AspNet.Security.OAuth.Weixin/WeixinAuthenticationHandler.cs
Outdated
Show resolved
Hide resolved
src/AspNet.Security.OAuth.Weixin/WeixinAuthenticationHandler.cs
Outdated
Show resolved
Hide resolved
src/AspNet.Security.OAuth.Weixin/WeixinAuthenticationHandler.cs
Outdated
Show resolved
Hide resolved
src/AspNet.Security.OAuth.Weixin/WeixinAuthenticationHandler.cs
Outdated
Show resolved
Hide resolved
src/AspNet.Security.OAuth.Weixin/WeixinAuthenticationHandler.cs
Outdated
Show resolved
Hide resolved
src/AspNet.Security.OAuth.Weixin/WeixinAuthenticationHandler.cs
Outdated
Show resolved
Hide resolved
|
Thank you for your comments. |
src/AspNet.Security.OAuth.Weixin/WeixinAuthenticationHandler.cs
Outdated
Show resolved
Hide resolved
src/AspNet.Security.OAuth.Weixin/WeixinAuthenticationHandler.cs
Outdated
Show resolved
Hide resolved
|
This looks OK to me now. As part of the preparation for ASP.NET Core 3.0 support, tests are being added to help make things easier to maintain and validate going forwards (see #292). Once tests are merged into the dev branch, can you rebase onto dev and update the relevant tests (if necessary) to account for these changes? |
|
Asp.NetCore 3.0 has not been studied yet, but I think I can try it. |
|
The tests target 2.2, not 3.0. They’re being done in advance of the 3.0 work in #280 as it involves a lot refactoring. |
|
#280 has been merged to |
|
The only difference with WeixinTests is Authorization Endpoint, but I added a new folder. I don't know if it's appropriate. |
test/AspNet.Security.OAuth.Providers.Tests/AspNet.Security.OAuth.Providers.Tests.csproj
Outdated
Show resolved
Hide resolved
test/AspNet.Security.OAuth.Providers.Tests/Infrastructure/LoopbackRedirectHandler.cs
Show resolved
Hide resolved
|
@martincostello Thank you for helping me revise these. |
|
@saber-wang 你好,目前我使用2.1版本测试情况如下: 但是,我同时配置两个Weixin Provider的时候不行了。Startpup.cs里面的配置如下: 请问,如果 要同时支持PC网页扫描登陆和微信客户端登陆,需要怎么样配置? 从我的测试来看,目前是不支持同时配置两个端。期待你的回复,谢谢! |
|
@liminany 在asp.net core中实际是通过CallbackPath来匹配Scheme的,所以你只需要配置不同的CallbackPath和Scheme就可以了例如 |
|
@saber-wang 非常感谢,没找到对应的使用文档,这个问题困扰了我好几天了,配置好callbackPath就可以了。 另外 在提个问题:如果还想要在手机浏览器(比如UC浏览器)中实现微信登陆应该怎样做? |
|
@liminany 在微信外部正常情况下都只能通过扫码登陆 |
|
@saber-wang PC端登陆可以,但换到手机浏览器,长按二维码登陆,提示 Scope参数错误或没有Scope权限 ,不知道什么原因 |
|
@liminany Scope参数错误或没有Scope权限 这个问题我也遇到了,但是是在PC扫码就提示这个,目前还没有找到问题所在 |
|
@saber-wang 微信登陆回调地址是不是可以携带额外参数? |
|
@StarkShang Splice it into the redirecturl |
|
@saber-wang redirecturi is configured in startup.cs, and changing the redirectUrl here has no effect. There is no query parameters in returnUrl. |
|
@StarkShang return Challenge(new AuthenticationProperties { RedirectUri = redirectUrl }, dto.Provider); here |

增加对微信网页授权的支持
https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842