Exemplo n.º 1
0
        /// <summary>
        /// 获取该工号已登陆的基础设施系统
        /// </summary>
        /// <param name="employeeID">工号</param>
        /// <returns></returns>
        public IEnumerable <OAuthValidateDto> GetBasicInfoLogin(string employeeID)
        {
            var validateList = Repository.Queryable().Where(m => m.EmployeeID == employeeID &&
                                                            m.Scope == ApplicationConstant.BASICINFO);

            var result = from a in validateList
                         join b in OAuthServiceRepository.Queryable() on a.ServiceNumber equals b.ServiceNumber
                         select new OAuthValidateDto()
            {
                AccessToken   = a.AccessToken,
                Code          = a.Code,
                CodeExpire    = a.CodeExpire,
                CreatedBy     = a.CreatedBy,
                CreatedTime   = a.CreatedTime,
                Domain        = b.DomainName,
                EmployeeID    = a.EmployeeID,
                ID            = a.ID,
                ModifiedBy    = a.ModifiedBy,
                ModifiedTime  = a.ModifiedTime,
                Password      = a.Password,
                Scope         = a.Scope,
                ServiceNumber = a.ServiceNumber,
                State         = a.State,
                Token         = a.Token
            };

            return(result.ToList());
        }
Exemplo n.º 2
0
        /// <summary>
        /// 验证该SSO管理服务是否存在
        /// </summary>
        /// <param name="clientId"></param>
        /// <param name="clientSecret"></param>
        /// <param name="redirectUrl"></param>
        /// <returns></returns>
        private OAuthServiceDto GetOAuthServiceInfo(string clientId, string clientSecret,
                                                    string redirectUrl)
        {
            var query = OAuthServiceRepository.Queryable().FirstOrDefault(m => m.ClientSecret == clientSecret &&
                                                                          m.ServiceNumber == clientId && m.RedirectUri == redirectUrl);

            return(query?.ToDto());
        }