Skip to content
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

add wechat official account providers. #790

Open
mrhoun opened this issue Jul 20, 2023 · 1 comment
Open

add wechat official account providers. #790

mrhoun opened this issue Jul 20, 2023 · 1 comment

Comments

@mrhoun
Copy link

mrhoun commented Jul 20, 2023

https://developers.weixin.qq.com/doc/offiaccount/en/OA_Web_Apps/Wechat_webpage_authorization.html

@LeaFrock
Copy link
Contributor

LeaFrock commented Aug 2, 2023

It seems that the current AspNet.Security.OAuth.Weixin should support your requirement, as long as you use the specific official account options instead of default ones.

After a quick check of mine, as least you should write the following codes for example,

AuthenticationBuilder builder = services.AddAuthentication();

builder.AddWeixin(opt => 
{
    // NOT use the default, "https://open.weixin.qq.com/connect/qrconnect"
    opt.AuthorizationEndpoint = "https://open.weixin.qq.com/connect/oauth2/authorize";
    // opt.Scope.Clear();
    opt.Scope.Add("snsapi_base");
    opt.Scope.Add("snsapi_userinfo");
});

You may have to take a try first. The source codes are not very complex, so you can even copy and debug them in your project if you meet other problems. Your feedback is welcomed.

BTW, adding a provider needs a careful decision and basically you won't expect someone else to make it.

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

No branches or pull requests

3 participants