微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

CollectiveOAuth C# 第三方授权框架

程序名称:CollectiveOAuth

授权协议: MIT

操作系统: 跨平台

开发语言: C#

CollectiveOAuth 介绍

![](/static/assets/osapp/images/4d8b9aee5ad2282eb9e1294150c85825.png) ![](/static/assets/osapp/images/6d8cdc95834cfc22fb40986f0ab3565d.png) ![](/static/assets/osapp/images/41582c874ad22870db379ff9d5febe96.png) ![](/static/assets/osapp/images/34d71d2b5f6c4a5ba401b490032f5671.png) ![](/static/assets/osapp/images/dd9fbb29c87c8066c33b09b244581d74.png) ![](/static/assets/osapp/images/234e513d341b3dd2094d0e074d72ce1b.png) ![](/static/assets/osapp/images/4ea9b01942c7ccd28ba16fe076baf6fa.png) ![](/static/assets/osapp/images/a853949a16cb926eb423eb031070e825.png) ![](/static/assets/osapp/images/aba94de5bf8dfddffbd619d6cdaaee31.png) ![](/static/assets/osapp/images/919d06b985c09eb32edc46c469012bb5.png) ![](/res/2021/03-14/13/5533dd9af7b85576cfcd4a9dc41cece6.png) ![](/static/assets/osapp/images/93af1a4f410e2ff0d05e78b8edf080d8.png) ![](/static/assets/osapp/images/dabe8a21b3e44f1d715f1b6a3f53df7c.png) ![](/static/assets/osapp/images/379ebf0e0315ad6fa6d07859ee1e96b2.png) ![](/static/assets/osapp/images/b340a3e638fd7c7d0072c4a85df50f35.png)


















.Net平台下 CollectiveOAuth ,它仅仅是一个 第三方授权登录工具类库
,它可以让我们脱离繁琐的第三方登录SDK,让登录变得 So easy!

特点

废话不多说,就俩字:

  1. :已集成十多家第三方平台(国内外常用的基本都已包含),仍然还在持续扩展中([开发计划(制作中)]!
  2. :API就是奔着最简单去设计的(见后面快速开始),尽量让您用起来没有障碍感!

快速开始

  • 引入依赖

  • 配置授权信息(认配置在webconfig中, 可以改造存储数据库或者其它任意地方)

    1
    2
    3
    4
    5 value="https://yours.domain.com/oauth2/callback?authSource=WECHAT_MP" />

  • 调用api

    // 创建授权request

    1 var clientConfig = new ClientConfig();
    2 clientConfig.clientId = AppSettingUtils.GetStrValue($”CollectiveOAuth_XXXXXX_ClientId”);
    3 clientConfig.clientSecret = AppSettingUtils.GetStrValue($”CollectiveOAuth_XXXXXX_ClientSecret”);
    4 clientConfig.redirectUri = AppSettingUtils.GetStrValue($”CollectiveOAuth_XXXXXX_RedirectUri”);
    5 clientConfig.scope = AppSettingUtils.GetStrValue($”CollectiveOAuth_XXXXXX_Scope”);
    6
    7 AuthRequest authRequest = new GiteeAuthRequest(clientConfig);
    8 // 生成授权页面
    9 authRequest.authorize(“state”);
    10 // 授权登录后会返回code(auth_code(仅限支付宝))、state,可以用AuthCallback类作为回调接口的参数
    11 // 注:CollectiveOAuth认保存state的时效为5分钟,5分钟内未使用则会自动清除过期的state
    12 authRequest.login(callback);

![](/static/assets/osapp/images/cf3c159012a238f7e1b94ed997ac0e1c.png) 平台 ![](/static/assets/osapp/images/2e5bfa97a7b93f9d9ab7aff4f8ff419e.png) API类 ![](/static/assets/osapp/images/924d157b1ef0fea257937d3cd693dcf5.png) SDK
![](/static/assets/osapp/images/4d8b9aee5ad2282eb9e1294150c85825.png) [GiteeAuthSource](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/GiteeAuthRequest.cs) [参考文档](https://gitee.com/api/v5/oauth_doc#list_1)
![](/static/assets/osapp/images/6d8cdc95834cfc22fb40986f0ab3565d.png) [GithubAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/GithubAuthRequest.cs) [参考文档](https://developer.github.com/apps/building-oauth-apps/authorizing- oauth-apps/)
![](/static/assets/osapp/images/41582c874ad22870db379ff9d5febe96.png) [WeiboAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/WeiboAuthRequest.cs) [参考文档](https://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E)
![](/static/assets/osapp/images/34d71d2b5f6c4a5ba401b490032f5671.png) [DingTalkScanAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/DingTalkScanAuthRequest.cs) [参考文档](https://open-doc.dingtalk.com/microapp/serverapi2/kymkv6)
![](/static/assets/osapp/images/dd9fbb29c87c8066c33b09b244581d74.png) [BaiduAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/BaiduAuthRequest.cs) [参考文档](http://developer.baidu.com/wiki/index.PHP?title=docs/oauth)
![](/static/assets/osapp/images/234e513d341b3dd2094d0e074d72ce1b.png) [CodingAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/CodingAuthRequest.cs) [参考文档](https://open.coding.net/references/oauth/)
![](/static/assets/osapp/images/a853949a16cb926eb423eb031070e825.png) [OschinaAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/OschinaAuthRequest.cs) [参考文档](https://www.oschina.net/openapi/docs/oauth2_authorize)
![](/static/assets/osapp/images/aba94de5bf8dfddffbd619d6cdaaee31.png) [AlipayMPAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/AlipayMpAuthRequest.cs) [参考文档](https://alipay.open.taobao.com/docs/doc.htm?spm=a219a.7629140.0.0.336d4b70GUKXOl&treeId=193&articleId=105809&docType=1)
![](/static/assets/osapp/images/919d06b985c09eb32edc46c469012bb5.png) [QQAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/QQAuthRequest.cs) [参考文档](https://wiki.connect.qq.com/%E4%BD%BF%E7%94%A8authorization_code%E8%8E%B7%E5%8F%96access_token)
![](/res/2021/03-14/13/5533dd9af7b85576cfcd4a9dc41cece6.png) [WeChatOpenAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/WeChatOpenAuthRequest.cs) [参考文档](https://open.weixin.qq.com/cgi- bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419316505&token=&lang=zh_CN)
![](/res/2021/03-14/13/5533dd9af7b85576cfcd4a9dc41cece6.png) [WeChatMPAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/WeChatMpAuthRequest.cs) [参考文档](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html)
![](/res/2021/03-14/13/5533dd9af7b85576cfcd4a9dc41cece6.png) [WeChatEnterpriseAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/WeChatEnterpriseAuthRequest.cs) [参考文档](https://open.work.weixin.qq.com/api/doc#90000/90135/90664)
![](/res/2021/03-14/13/5533dd9af7b85576cfcd4a9dc41cece6.png) [WeChatEnterpriseScanAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/WeChatEnterpriseScanAuthRequest.cs) [参考文档](https://open.work.weixin.qq.com/api/doc#90000/90135/90664)
![](/static/assets/osapp/images/93af1a4f410e2ff0d05e78b8edf080d8.png) [TaobaoAuthRequest] [参考文档](https://open.taobao.com/doc.htm?spm=a219a.7386797.0.0.4e00669acnkQy6&source=search&docId=105590&docType=1)
![](/static/assets/osapp/images/dabe8a21b3e44f1d715f1b6a3f53df7c.png) [GoogleAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/GoogleAuthRequest.cs) [参考文档](https://developers.google.com/identity/protocols/OpenIDConnect)
![](/static/assets/osapp/images/379ebf0e0315ad6fa6d07859ee1e96b2.png) [FacebookAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/FackbookAuthRequest.cs) [参考文档](https://developers.facebook.com/docs/facebook-login/manually-build-a- login-flow)
![](/static/assets/osapp/images/b340a3e638fd7c7d0072c4a85df50f35.png) [DouYinAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/DouYinAuthRequest.cs) [参考文档](https://www.douyin.com/platform/doc/m-2-1-1)
![](/res/2021/03-14/13/ea42b08de14746703d21f99c23ae8a66.png) [LinkedInAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/LinkedinAuthRequest.cs) [参考文档](https://docs.microsoft.com/zh- cn/linkedin/shared/authentication/authorization-code- flow?context=linkedin/context)
![](/res/2021/03-14/13/3a99882514394d6c2dc1323a63d65a79.png) [MicrosoftAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/MicrosoftAuthRequest.cs) [参考文档](https://docs.microsoft.com/zh-cn/graph/auth/)
![](/res/2021/03-14/13/efcf6d7697fea1b8e696f789d023840e.png) [XiaoMiAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/XiaoMiAuthRequest.cs) [参考文档](https://dev.mi.com/console/doc/detail?pId=711)
![](/res/2021/03-14/13/e0f5f2600c93981f3c5e6ae21052f5fa.png) [ToutiaoAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/ToutiaoAuthRequest.cs) [参考文档](https://open.mp.toutiao.com/#/resource?_k=y7mfgk)
![](/res/2021/03-14/13/3ec6455607865ab1ef30140ac9574055.png) [TeambitionAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/TeambitionAuthRequest.cs) [参考文档](https://docs.teambition.com/)
![](/res/2021/03-14/13/3cc278339efb815892194ceac6e836ae.png) [RenrenAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/RenrenAuthRequest.cs) [参考文档](http://open.renren.com/wikI/OAuth2.0)
![](/res/2021/03-14/13/7d4c52e7b885375c6e36a539e27e6f4e.png) [PinterestAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/PinterestAuthRequest.cs) [参考文档](https://developers.pinterest.com/docs/apI/Overview/?)
![](/res/2021/03-14/13/4c2fcf11fa8e0fa8fb1df318de43ad34.png) [StackOverflowAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/StackOverflowAuthRequest.cs) [参考文档](https://api.stackexchange.com/docs/authentication)
![](/res/2021/03-14/13/1c622563e484187e6c6ca1e99e9a3aab.png) [HuaweiAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/HuaweiAuthRequest.cs) [参考文档](https://developer.huawei.com/consumer/cn/devservice/doc/30101)
![](/res/2021/03-14/13/67b42c3cb954973a99f474f1f9f58dff.png) [KujialeAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/KujialeAuthRequest.cs) [参考文档](https://open.kujiale.com/open/apps/2/docs?doc_id=95)
![](/res/2021/03-14/13/fed9908cecfcb09a1176701d57beb775.png) [GitlabAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/GitlabAuthRequest.cs) [参考文档](https://docs.gitlab.com/ee/apI/Oauth2.html)
![](/res/2021/03-14/13/23c089e8b87ade612cdc0eaaeafbf3f8.png) [MeituanAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/MeituanAuthRequest.cs) [参考文档](http://open.waimai.meituan.com/openapi_docs/oauth/)
![](/res/2021/03-14/13/6ea4f1f1b176aa93b599d1daec9f277d.png) [ElemeAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/ElemeAuthRequest.cs) [参考文档](https://open.shop.ele.me/openapi/documents/khd001)
![](http://codingdict.com/static/assets/osapp/images/04ec2d7b85597619872a3ff0f9d77ede.png) [TwitterauthRequest] [参考文档](https://developer.twitter.com/en/docs/twitter-for-websites/log-in-with- twitter/guides/implementing-sign-in-with-twitter)

_请知悉:经咨询CSDN官方客服得知,CSDN的授权开放平台已经下线。如果以前申请过的应用,可以继续使用,但是不再支持申请新的应用。

CollectiveOAuth 官网

https://gitee.com/rthinking/CollectiveOAuth

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐