添加项目文件。

This commit is contained in:
2023-03-13 15:00:34 +08:00
parent 42bf06ca3e
commit 1d73df3235
1205 changed files with 185078 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 支付宝服务窗.
/// </summary>
public class AlipayMPAuthSource : IAuthSource
{
public string authorize()
{
return "https://openauth.alipay.com/oauth2/publicAppAuthorize.htm";
}
public string accessToken()
{
return "https://openapi.alipay.com/gateway.do";
}
public string userInfo()
{
return "https://openapi.alipay.com/gateway.do";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.ALIPAY_MP.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 百度开放平台.
/// </summary>
public class BaiduAuthSource : IAuthSource
{
public string authorize()
{
return "https://openapi.baidu.com/oauth/2.0/authorize";
}
public string accessToken()
{
return "https://openapi.baidu.com/oauth/2.0/token";
}
public string userInfo()
{
return "https://openapi.baidu.com/rest/2.0/passport/users/getInfo";
}
public string revoke()
{
return "https://openapi.baidu.com/rest/2.0/passport/auth/revokeAuthorization";
}
public string refresh()
{
return "https://openapi.baidu.com/oauth/2.0/token";
}
public string getName()
{
return DefaultAuthSourceEnum.BAIDU.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// Coding扣钉.
/// </summary>
public class CodingAuthSource : IAuthSource
{
public string authorize()
{
return "https://coding.net/oauth_authorize.html";
}
public string accessToken()
{
return "https://coding.net/api/oauth/access_token";
}
public string userInfo()
{
return "https://coding.net/api/account/current_user";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.CODING.ToString();
}
}

View File

@@ -0,0 +1,42 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 钉钉扫码.
/// </summary>
public class DingTalkScanAuthSource : IAuthSource
{
public string authorize()
{
return "https://login.dingtalk.com/oauth2/auth";
//return "https://oapi.dingtalk.com/connect/qrconnect";
}
public string accessToken()
{
return "https://api.dingtalk.com/v1.0/oauth2/userAccessToken";
//throw new System.NotImplementedException(AuthResponseStatus.UNSUPPORTED.GetDesc());
}
public string userInfo()
{
return "https://api.dingtalk.com/v1.0/contact/users/me";
//return "https://oapi.dingtalk.com/sns/getuserinfo_bycode"; ;
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.DINGTALK.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 抖音.
/// </summary>
public class DouyinAuthSource : IAuthSource
{
public string authorize()
{
return "https://open.douyin.com/platform/oauth/connect";
}
public string accessToken()
{
return "https://open.douyin.com/oauth/access_token/";
}
public string userInfo()
{
return "https://open.douyin.com/oauth/userinfo/";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
return "https://open.douyin.com/oauth/refresh_token/";
}
public string getName()
{
return DefaultAuthSourceEnum.DOUYIN.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 饿了么.
/// </summary>
public class ElemeAuthSource : IAuthSource
{
public string authorize()
{
return "https://open-api.shop.ele.me/authorize";
}
public string accessToken()
{
return "https://open-api.shop.ele.me/token";
}
public string userInfo()
{
return "https://open-api.shop.ele.me/api/v1/";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
return "https://open-api.shop.ele.me/token";
}
public string getName()
{
return DefaultAuthSourceEnum.ELEME.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// Facebook.
/// </summary>
public class FackbookAuthSource : IAuthSource
{
public string authorize()
{
return "https://www.facebook.com/v3.3/dialog/oauth";
}
public string accessToken()
{
return "https://graph.facebook.com/v3.3/oauth/access_token";
}
public string userInfo()
{
return "https://graph.facebook.com/v3.3/me";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.FACEBOOK.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 飞书.
/// </summary>
public class FeiShuAuthSource : IAuthSource
{
public string authorize()
{
return "https://open.feishu.cn/open-apis/authen/v1/index";
}
public string accessToken()
{
return "https://open.feishu.cn/open-apis/authen/v1/access_token";
}
public string userInfo()
{
return "https://open.feishu.cn/open-apis/authen/v1/user_info";
}
public string revoke()
{
return "https://open.feishu.cn/open-apis/authen/v1/refresh_access_token";
}
public string refresh()
{
return "https://open.feishu.cn/open-apis/authen/v1/refresh_access_token";
}
public string getName()
{
return DefaultAuthSourceEnum.FEISHU.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// Gitee.
/// </summary>
public class GiteeAuthSource : IAuthSource
{
public string authorize()
{
return "https://gitee.com/oauth/authorize";
}
public string accessToken()
{
return "https://gitee.com/oauth/token";
}
public string userInfo()
{
return "https://gitee.com/api/v5/user";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.GITEE.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// Github.
/// </summary>
public class GithubAuthSource : IAuthSource
{
public string authorize()
{
return "https://github.com/login/oauth/authorize";
}
public string accessToken()
{
return "https://github.com/login/oauth/access_token";
}
public string userInfo()
{
return "https://api.github.com/user";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.GITHUB.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// Gitlab.
/// </summary>
public class GitlabAuthSource : IAuthSource
{
public string authorize()
{
return "https://gitlab.com/oauth/authorize";
}
public string accessToken()
{
return "https://gitlab.com/oauth/token";
}
public string userInfo()
{
return "https://gitlab.com/api/v4/user";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.GITLAB.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// Google(谷歌).
/// </summary>
public class GoogleAuthSource : IAuthSource
{
public string authorize()
{
return "https://accounts.google.com/o/oauth2/v2/auth";
}
public string accessToken()
{
return "https://www.googleapis.com/oauth2/v4/token";
}
public string userInfo()
{
return "https://www.googleapis.com/oauth2/v3/userinfo";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.GOOGLE.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 华为.
/// </summary>
public class HuaweiAuthSource : IAuthSource
{
public string authorize()
{
return "https://oauth-login.cloud.huawei.com/oauth2/v2/authorize";
}
public string accessToken()
{
return "https://oauth-login.cloud.huawei.com/oauth2/v2/token";
}
public string userInfo()
{
return "https://api.vmall.com/rest.php";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
return "https://oauth.kujiale.com/oauth2/auth/token/refresh";
}
public string getName()
{
return DefaultAuthSourceEnum.KUJIALE.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 酷家乐.
/// </summary>
public class KujialeAuthSource : IAuthSource
{
public string authorize()
{
return "https://oauth.kujiale.com/oauth2/show";
}
public string accessToken()
{
return "https://oauth.kujiale.com/oauth2/auth/token";
}
public string userInfo()
{
return "https://oauth.kujiale.com/oauth2/openapi/user";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
return "https://oauth-login.cloud.huawei.com/oauth2/v2/token";
}
public string getName()
{
return DefaultAuthSourceEnum.KUJIALE.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// Linkin领英.
/// </summary>
public class LinkedInAuthSource : IAuthSource
{
public string authorize()
{
return "https://www.linkedin.com/oauth/v2/authorization";
}
public string accessToken()
{
return "https://www.linkedin.com/oauth/v2/accessToken";
}
public string userInfo()
{
return "https://api.linkedin.com/v2/me";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
return "https://www.linkedin.com/oauth/v2/accessToken";
}
public string getName()
{
return DefaultAuthSourceEnum.LINKEDIN.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 美团.
/// </summary>
public class MeituanAuthSource : IAuthSource
{
public string authorize()
{
return "https://openapi.waimai.meituan.com/oauth/authorize";
}
public string accessToken()
{
return "https://openapi.waimai.meituan.com/oauth/access_token";
}
public string userInfo()
{
return "https://openapi.waimai.meituan.com/oauth/userinfo";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
return "https://openapi.waimai.meituan.com/oauth/refresh_token";
}
public string getName()
{
return DefaultAuthSourceEnum.MEITUAN.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 微软.
/// </summary>
public class MicrosoftAuthSource : IAuthSource
{
public string authorize()
{
return "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
}
public string accessToken()
{
return "https://login.microsoftonline.com/common/oauth2/v2.0/token";
}
public string userInfo()
{
return "https://graph.microsoft.com/v1.0/me";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
return "https://login.microsoftonline.com/common/oauth2/v2.0/token";
}
public string getName()
{
return DefaultAuthSourceEnum.MICROSOFT.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// OSChina开源中国.
/// </summary>
public class OschinaAuthSource : IAuthSource
{
public string authorize()
{
return "https://www.oschina.net/action/oauth2/authorize";
}
public string accessToken()
{
return "https://www.oschina.net/action/openapi/token";
}
public string userInfo()
{
return "https://www.oschina.net/action/openapi/user";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.OSCHINA.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// Pinterest.
/// </summary>
public class PinterestAuthSource : IAuthSource
{
public string authorize()
{
return "https://api.pinterest.com/oauth";
}
public string accessToken()
{
return "https://api.pinterest.com/v1/oauth/token";
}
public string userInfo()
{
return "https://api.pinterest.com/v1/me";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.PINTEREST.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 腾讯QQ.
/// </summary>
public class QQAuthSource : IAuthSource
{
public string authorize()
{
return "https://graph.qq.com/oauth2.0/authorize";
}
public string accessToken()
{
return "https://graph.qq.com/oauth2.0/token";
}
public string userInfo()
{
return "https://graph.qq.com/user/get_user_info";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
return "https://graph.qq.com/oauth2.0/token";
}
public string getName()
{
return DefaultAuthSourceEnum.QQ.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 人人网.
/// </summary>
public class RenrenAuthSource : IAuthSource
{
public string authorize()
{
return "https://graph.renren.com/oauth/authorize";
}
public string accessToken()
{
return "https://graph.renren.com/oauth/token";
}
public string userInfo()
{
return "https://api.renren.com/v2/user/get";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
return "https://graph.renren.com/oauth/token";
}
public string getName()
{
return DefaultAuthSourceEnum.RENREN.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// Stack Overflow.
/// </summary>
public class StackOverflowAuthSource : IAuthSource
{
public string authorize()
{
return "https://stackoverflow.com/oauth";
}
public string accessToken()
{
return "https://stackoverflow.com/oauth/access_token/json";
}
public string userInfo()
{
return "https://api.stackexchange.com/2.2/me";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.STACK_OVERFLOW.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 淘宝.
/// </summary>
public class TaobaoAuthSource : IAuthSource
{
public string authorize()
{
return "https://oauth.taobao.com/authorize";
}
public string accessToken()
{
return "https://oauth.taobao.com/token";
}
public string userInfo()
{
throw new System.NotImplementedException();
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.TAOBAO.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// Teambition.
/// </summary>
public class TeambitionAuthSource : IAuthSource
{
public string authorize()
{
return "https://account.teambition.com/oauth2/authorize";
}
public string accessToken()
{
return "https://account.teambition.com/oauth2/access_token";
}
public string userInfo()
{
return "https://api.teambition.com/users/me";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
return "https://account.teambition.com/oauth2/refresh_token";
}
public string getName()
{
return DefaultAuthSourceEnum.TEAMBITION.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 今日头条.
/// </summary>
public class ToutiaoAuthSource : IAuthSource
{
public string authorize()
{
return "https://open.snssdk.com/auth/authorize";
}
public string accessToken()
{
return "https://open.snssdk.com/auth/token";
}
public string userInfo()
{
return "https://open.snssdk.com/data/user_profile";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.TOUTIAO.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// Twitter.
/// </summary>
public class TwitterAuthSource : IAuthSource
{
public string authorize()
{
return "https://api.twitter.com/oauth/authenticate";
}
public string accessToken()
{
return "https://api.twitter.com/oauth/access_token";
}
public string userInfo()
{
return "https://api.twitter.com/1.1/users/show.json";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.TWITTER.ToString();
}
}

View File

@@ -0,0 +1,41 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 企业微信.
/// </summary>
public class WechatEnterpriseAuthSource : IAuthSource
{
public string accessToken()
{
return "https://qyapi.weixin.qq.com/cgi-bin/gettoken";
}
public string authorize()
{
//return "https://open.work.weixin.qq.com/wwopen/sso/qrConnect";
return "https://open.weixin.qq.com/connect/oauth2/authorize";
}
public string getName()
{
return DefaultAuthSourceEnum.WECHAT_ENTERPRISE.ToString();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string userInfo()
{
return "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo";
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 企业微信扫码.
/// </summary>
public class WechatEnterpriseScanAuthSource : IAuthSource
{
public string accessToken()
{
return "https://qyapi.weixin.qq.com/cgi-bin/gettoken";
}
public string authorize()
{
return "https://open.work.weixin.qq.com/wwopen/sso/qrConnect";
}
public string getName()
{
return DefaultAuthSourceEnum.WECHAT_ENTERPRISE_SCAN.ToString();
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string userInfo()
{
return "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo";
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 微信公众平台.
/// </summary>
public class WechatMPAuthSource : IAuthSource
{
public string accessToken()
{
return "https://api.weixin.qq.com/sns/oauth2/access_token";
}
public string authorize()
{
return "https://open.weixin.qq.com/connect/oauth2/authorize";
}
public string getName()
{
return DefaultAuthSourceEnum.WECHAT_MP.ToString();
}
public string refresh()
{
return "https://api.weixin.qq.com/sns/oauth2/refresh_token";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string userInfo()
{
return "https://api.weixin.qq.com/sns/userinfo";
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 微信开放平台.
/// </summary>
public class WechatOpenAuthSource : IAuthSource
{
public string accessToken()
{
return "https://api.weixin.qq.com/sns/oauth2/access_token";
}
public string authorize()
{
return "https://open.weixin.qq.com/connect/qrconnect";
}
public string getName()
{
return DefaultAuthSourceEnum.WECHAT_OPEN.ToString();
}
public string refresh()
{
return "https://api.weixin.qq.com/sns/oauth2/refresh_token";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string userInfo()
{
return "https://api.weixin.qq.com/sns/userinfo";
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 微博.
/// </summary>
public class WeiboAuthSource : IAuthSource
{
public string authorize()
{
return "https://api.weibo.com/oauth2/authorize";
}
public string accessToken()
{
return "https://api.weibo.com/oauth2/access_token";
}
public string userInfo()
{
return "https://api.weibo.com/2/users/show.json";
}
public string revoke()
{
return "https://api.weibo.com/oauth2/revokeoauth2";
}
public string refresh()
{
throw new System.NotImplementedException();
}
public string getName()
{
return DefaultAuthSourceEnum.WEIBO.ToString();
}
}

View File

@@ -0,0 +1,39 @@
using JNPF.Extras.CollectiveOAuth.Enums;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// 小米开放平台.
/// </summary>
public class XiaoMiAuthSource : IAuthSource
{
public string authorize()
{
return "https://account.xiaomi.com/oauth2/authorize";
}
public string accessToken()
{
return "https://account.xiaomi.com/oauth2/token";
}
public string userInfo()
{
return "https://open.account.xiaomi.com/user/profile";
}
public string revoke()
{
throw new System.NotImplementedException();
}
public string refresh()
{
return "https://account.xiaomi.com/oauth2/token";
}
public string getName()
{
return DefaultAuthSourceEnum.XIAOMI.ToString();
}
}

View File

@@ -0,0 +1,56 @@
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// CollectiveOAuth配置类
/// <para>@author wei.fu (wei.fu@rthinkingsoft.cn).</para>
/// <para>@since 1.8.</para>
/// </summary>
public class ClientConfig
{
/// <summary>
/// 客户端id对应各平台的appKey.
/// </summary>
public string clientId { get; set; }
/// <summary>
/// 客户端Secret对应各平台的appSecret.
/// </summary>
public string clientSecret { get; set; }
/// <summary>
/// 登录成功后的回调地址.
/// </summary>
public string redirectUri { get; set; }
/// <summary>
/// 支付宝公钥:当选择支付宝登录时,该值可用
/// 对应“RSA2(SHA256)密钥”中的“支付宝公钥”.
/// </summary>
public string alipayPublicKey { get; set; }
/// <summary>
/// 是否需要申请unionid目前只针对qq登录.
/// <para>注qq授权登录时获取unionid需要单独发送邮件申请权限。如果个人开发者账号中申请了该权限可以将该值置为true在获取openId时就会同步获取unionId.</para>
/// <para>参考链接http://wiki.connect.qq.com/unionid%E4%BB%8B%E7%BB%8D.</para>
/// <para>1.7.1版本新增参数.</para>
/// </summary>
public string unionId { get; set; }
/// <summary>
/// <para>Stack Overflow Key.</para>
/// <para>@since 1.9.0.</para>
/// </summary>
public string stackOverflowKey { get; set; }
/// <summary>
/// 企业微信授权方的网页应用ID.
/// <para>@since 1.10.0.</para>
/// </summary>
public string agentId { get; set; }
/// <summary>
/// 企业微信授权方的网页应用ID.
/// <para>@since 1.10.0.</para>
/// </summary>
public string scope { get; set; }
}

View File

@@ -0,0 +1,102 @@
using System.ComponentModel;
namespace JNPF.Extras.CollectiveOAuth.Enums;
public enum DefaultAuthSourceEnum
{
[Description("微信公众平台")]
WECHAT_MP,
[Description("微信开放平台")]
WECHAT_OPEN,
[Description("企业微信自动授权")]
WECHAT_ENTERPRISE,
[Description("企业微信扫码")]
WECHAT_ENTERPRISE_SCAN,
[Description("支付宝服务窗")]
ALIPAY_MP,
[Description("码云授权")]
GITEE,
[Description("Github授权")]
GITHUB,
[Description("百度开放平台")]
BAIDU,
[Description("小米开放平台")]
XIAOMI,
[Description("钉钉扫码")]
DINGTALK,
[Description("OSChina开源中国")]
OSCHINA,
[Description("Coding扣钉")]
CODING,
[Description("LinkedIn领英")]
LINKEDIN,
[Description("微博")]
WEIBO,
[Description("腾讯QQ")]
QQ,
[Description("抖音")]
DOUYIN,
[Description("Google(谷歌)")]
GOOGLE,
[Description("Facebook")]
FACEBOOK,
[Description("微软")]
MICROSOFT,
[Description("今日头条")]
TOUTIAO,
[Description("Teambition")]
TEAMBITION,
[Description("人人网")]
RENREN,
[Description("Pinterest")]
PINTEREST,
[Description("Stack Overflow")]
STACK_OVERFLOW,
[Description("华为")]
HUAWEI,
[Description("酷家乐")]
KUJIALE,
[Description("Gitlab")]
GITLAB,
[Description("美团")]
MEITUAN,
[Description("饿了么")]
ELEME,
[Description("Twitter")]
TWITTER,
[Description("淘宝")]
TAOBAO,
[Description("飞书")]
FEISHU,
}

View File

@@ -0,0 +1,56 @@
using JNPF.Extras.CollectiveOAuth.Enums;
using JNPF.Extras.CollectiveOAuth.Models;
using JNPF.Extras.CollectiveOAuth.Request;
namespace JNPF.Extras.CollectiveOAuth.Config;
/// <summary>
/// OAuth平台的API地址的统一接口提供以下方法.
/// <para>1)<see cref="IAuthSource.authorize"/>: 获取授权url. 必须实现.</para>
/// <para>2)<see cref="IAuthSource.accessToken"/>: 获取accessToken的url. 必须实现.</para>
/// <para>3)<see cref="IAuthSource.userInfo"/>: 获取用户信息的url. 必须实现.</para>
/// <para>4)<see cref="IAuthSource.revoke"/>: 获取取消授权的url. 非必须实现接口(部分平台不支持).</para>
/// <para>5)<see cref="IAuthSource.refresh"/>: 获取刷新授权的url. 非必须实现接口(部分平台不支持).</para>
/// 注:.
/// <para> ①、如需通过JustAuth扩展实现第三方授权请参考<see cref="DefaultAuthSourceEnum"/>自行创建对应的枚举类并实现<see cref="IAuthSource"/>接口.</para>
/// <para> ②、如果不是使用的枚举类那么在授权成功后获取用户信息时需要单独处理source字段的赋值.</para>
/// <para> ③、如果扩展了对应枚举类时,在<see cref="IAuthRequest.login(AuthCallback)"/>中可以通过<c>xx.toString()</c>获取对应的source.</para>
/// </summary>
public interface IAuthSource
{
/// <summary>
/// 授权的api.
/// </summary>
/// <returns>utl.</returns>
string authorize();
/// <summary>
/// 获取accessToken的api.
/// </summary>
/// <returns>utl.</returns>
string accessToken();
/// <summary>
/// 获取用户信息的api.
/// </summary>
/// <returns>utl.</returns>
string userInfo();
/// <summary>
/// 取消授权的api.
/// </summary>
/// <returns>utl.</returns>
string revoke();
/// <summary>
/// 刷新授权的api.
/// </summary>
/// <returns>utl.</returns>
string refresh();
/// <summary>
/// 获取Source的字符串名字.
/// </summary>
/// <returns>utl.</returns>
string getName();
}