zhaolei
2020-11-20 921de2254ff5712a44ed8575ee8efe34252f6603
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using Prow.OAuth;
using Microsoft.AspNetCore.Authentication.OAuth.Claims;
using System.Security.Claims;
 
namespace Prow.TencentAuth
{
    /// <summary>
    /// Gitee 认证配置实体类
    /// </summary>
    public class TencentOptions : LgbOAuthOptions
    {
        /// <summary>
        /// 获得/设置 OpenId 地址
        /// </summary>
        public string OpenIdEndpoint { get; set; }
 
        /// <summary>
        /// 构造函数
        /// </summary>
        public TencentOptions() : base()
        {
            AuthorizationEndpoint = TencentDefaults.AuthorizationEndpoint;
            TokenEndpoint = TencentDefaults.TokenEndpoint;
            UserInformationEndpoint = TencentDefaults.UserInformationEndpoint;
            HomePath = TencentDefaults.HomePath;
            OpenIdEndpoint = TencentDefaults.OpenIdEndpoint;
 
            // 设置登陆信息
            ClaimActions.Remove(ClaimTypes.Name);
            ClaimActions.Add(new JsonKeyClaimAction(ClaimTypes.Name, ClaimValueTypes.String, "nickname"));
        }
    }
}