Skip to content

An ASP.NET Core authentication middleware: QQConnect for https://connect.qq.com (腾讯QQ互联平台/QQ登录)

License

Notifications You must be signed in to change notification settings

myvas/AspNetCore.Authentication.QQConnect

Repository files navigation

Myvas.AspNetCore.Authentication Family

  • QQConnect: this repo

QQConnect GitHub (Pre-)Release Date NuGet

WeixinOpen GitHub (Pre-)Release Date NuGet

WeixinAuth GitHub (Pre-)Release Date NuGet

What's this?

An ASP.NET Core authentication middleware for https://connect.qq.com (腾讯QQ互联平台/QQ登录)

  • 须腾讯QQ互联平台(connect.qq.com)账号。
  • 用户可通过点击“QQ登录”图标按钮一键登入网站,或使用手机QQ程序扫码登入网站,当然,也可以输入QQ账号密码登入网站。

How to Use?

0.Create account

在腾讯QQ互联平台(https://connect.qq.com)上创建应用(网站应用,移动应用),并指定网站回调地址(例如:https://www.myvas.com/signin-qqconnect),记下AppId和AppKey。

1.nuget

2.Configure

    app.UseAuthentication();

3.ConfigureServices

services.AddAuthentication()
    // using Myvas.AspNetCore.Authentication;
    .AddQQConnect(options => 
    {
        options.AppId = Configuration["QQConnect:AppId"];
        options.AppKey = Configuration["QQConnect:AppKey"];

        options.CallbackPath = "/signin-qqconnect"; //default

        QQConnectScopes.TryAdd(options.Scope,
            QQConnectScopes.get_user_info,
            QQConnectScopes.list_album, //需要额外开通权限,暂未实现
            QQConnectScopes.upload_pic, //需要额外开通权限,暂未实现
            QQConnectScopes.do_like); //需要额外开通权限,暂未实现
    };

Dev

Demo Online