CollectiveOAuth 介绍
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.Net平台下 CollectiveOAuth ,它仅仅是一个 第三方授权登录 的 工具类库
,它可以让我们脱离繁琐的第三方登录SDK,让登录变得 So easy!
特点
废话不多说,就俩字:
- 全 :已集成十多家第三方平台(国内外常用的基本都已包含),仍然还在持续扩展中([开发计划(制作中)]!
- 简 :API就是奔着最简单去设计的(见后面快速开始),尽量让您用起来没有障碍感!
快速开始
-
引入依赖
-
-
配置授权信息(默认配置在webconfig中, 可以改造存储数据库或者其它任意地方)
1
2
3
4
5value="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);
 平台 |  API类 |  SDK |
---|---|---|
 | [GiteeAuthSource](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/GiteeAuthRequest.cs) | [参考文档](https://gitee.com/api/v5/oauth_doc#list_1) |
 | [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/) |
 | [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) |
 | [DingTalkScanAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/DingTalkScanAuthRequest.cs) | [参考文档](https://open-doc.dingtalk.com/microapp/serverapi2/kymkv6) |
 | [BaiduAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/BaiduAuthRequest.cs) | [参考文档](http://developer.baidu.com/wiki/index.php?title=docs/oauth) |
 | [CodingAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/CodingAuthRequest.cs) | [参考文档](https://open.coding.net/references/oauth/) |
 | [OschinaAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/OschinaAuthRequest.cs) | [参考文档](https://www.oschina.net/openapi/docs/oauth2_authorize) |
 | [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) |
 | [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) |
 | [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) |
 | [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) |
 | [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) |
 | [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) |
 | [TaobaoAuthRequest] | [参考文档](https://open.taobao.com/doc.htm?spm=a219a.7386797.0.0.4e00669acnkQy6&source=search&docId=105590&docType=1) |
 | [GoogleAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/GoogleAuthRequest.cs) | [参考文档](https://developers.google.com/identity/protocols/OpenIDConnect) |
 | [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) |
 | [DouYinAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/DouYinAuthRequest.cs) | [参考文档](https://www.douyin.com/platform/doc/m-2-1-1) |
 | [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) |
 | [MicrosoftAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/MicrosoftAuthRequest.cs) | [参考文档](https://docs.microsoft.com/zh-cn/graph/auth/) |
 | [XiaoMiAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/XiaoMiAuthRequest.cs) | [参考文档](https://dev.mi.com/console/doc/detail?pId=711) |
 | [ToutiaoAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/ToutiaoAuthRequest.cs) | [参考文档](https://open.mp.toutiao.com/#/resource?_k=y7mfgk) |
 | [TeambitionAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/TeambitionAuthRequest.cs) | [参考文档](https://docs.teambition.com/) |
 | [RenrenAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/RenrenAuthRequest.cs) | [参考文档](http://open.renren.com/wiki/OAuth2.0) |
 | [PinterestAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/PinterestAuthRequest.cs) | [参考文档](https://developers.pinterest.com/docs/api/overview/?) |
 | [StackOverflowAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/StackOverflowAuthRequest.cs) | [参考文档](https://api.stackexchange.com/docs/authentication) |
 | [HuaweiAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/HuaweiAuthRequest.cs) | [参考文档](https://developer.huawei.com/consumer/cn/devservice/doc/30101) |
 | [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) |
 | [GitlabAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/GitlabAuthRequest.cs) | [参考文档](https://docs.gitlab.com/ee/api/oauth2.html) |
 | [MeituanAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/MeituanAuthRequest.cs) | [参考文档](http://open.waimai.meituan.com/openapi_docs/oauth/) |
 | [ElemeAuthRequest](https://gitee.com/rthinking/CollectiveOAuth/blob/master/Come.CollectiveOAuth/Request/AuthRequests/ElemeAuthRequest.cs) | [参考文档](https://open.shop.ele.me/openapi/documents/khd001) |
 | [TwitterAuthRequest] | [参考文档](https://developer.twitter.com/en/docs/twitter-for-websites/log-in-with- twitter/guides/implementing-sign-in-with-twitter) |
_请知悉:经咨询CSDN官方客服得知,CSDN的授权开放平台已经下线。如果以前申请过的应用,可以继续使用,但是不再支持申请新的应用。