Skip to content

Conversation

@saber-wang
Copy link
Contributor

@saber-wang saber-wang changed the title Increase support for authorization of Wechat Web pages Increase support for authorization of Wechat Webpage Jan 14, 2019
@martincostello
Copy link
Member

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
@saber-wang
Copy link
Contributor Author

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

@saber-wang
Copy link
Contributor Author

Thank you for your comments.

@martincostello
Copy link
Member

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?

@saber-wang
Copy link
Contributor Author

Asp.NetCore 3.0 has not been studied yet, but I think I can try it.

@martincostello
Copy link
Member

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.

@martincostello
Copy link
Member

#280 has been merged to dev now. If you rebase and update any tests as appropriate, we can look at merging this PR soon.

@saber-wang
Copy link
Contributor Author

The only difference with WeixinTests is Authorization Endpoint, but I added a new folder. I don't know if it's appropriate.

saber-wang and others added 4 commits May 20, 2019 20:36
This reverts commit 7891b25.
Refactor the handling for _oauthstate to improve the readability of the code flow and match style.
@saber-wang
Copy link
Contributor Author

@martincostello Thank you for helping me revise these.

@martincostello martincostello added this to the 2.1.0 milestone May 24, 2019
@liminany
Copy link

liminany commented Jul 9, 2019

@saber-wang 你好,目前我使用2.1版本测试情况如下:
当只配置一个Weixin Provider时(开放平台和公众平台二选一)时没有问题

但是,我同时配置两个Weixin Provider的时候不行了。Startpup.cs里面的配置如下:

image

请问,如果 要同时支持PC网页扫描登陆和微信客户端登陆,需要怎么样配置?

从我的测试来看,目前是不支持同时配置两个端。期待你的回复,谢谢!

@saber-wang
Copy link
Contributor Author

@liminany 在asp.net core中实际是通过CallbackPath来匹配Scheme的,所以你只需要配置不同的CallbackPath和Scheme就可以了例如options.CallbackPath = "/signin-Wechat"

@liminany
Copy link

liminany commented Jul 9, 2019

@saber-wang 非常感谢,没找到对应的使用文档,这个问题困扰了我好几天了,配置好callbackPath就可以了。

另外 在提个问题:如果还想要在手机浏览器(比如UC浏览器)中实现微信登陆应该怎样做?

@saber-wang
Copy link
Contributor Author

@liminany 在微信外部正常情况下都只能通过扫码登陆

@liminany
Copy link

liminany commented Jul 9, 2019

@saber-wang PC端登陆可以,但换到手机浏览器,长按二维码登陆,提示 Scope参数错误或没有Scope权限 ,不知道什么原因

@saber-wang
Copy link
Contributor Author

@liminany Scope参数错误或没有Scope权限 这个问题我也遇到了,但是是在PC扫码就提示这个,目前还没有找到问题所在

@StarkShang
Copy link

@saber-wang 微信登陆回调地址是不是可以携带额外参数?
return Challenge(new AuthenticationProperties { RedirectUri = redirectUrl }, dto.Provider);

@saber-wang
Copy link
Contributor Author

@StarkShang Splice it into the redirecturl

@StarkShang
Copy link

@saber-wang redirecturi is configured in startup.cs, and changing the redirectUrl here has no effect. There is no query parameters in returnUrl.

@saber-wang
Copy link
Contributor Author

saber-wang commented Jul 10, 2020

@StarkShang return Challenge(new AuthenticationProperties { RedirectUri = redirectUrl }, dto.Provider); here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants