Exemplo n.º 1
0
        public virtual async Task <IdentityClaimType> CreateAsync(IdentityClaimType claimType)
        {
            if (await _identityClaimTypeRepository.AnyAsync(claimType.Name))
            {
                throw new AbpException($"Name Exist: {claimType.Name}");
            }

            return(await _identityClaimTypeRepository.InsertAsync(claimType));
        }
Exemplo n.º 2
0
        private async Task CreateWeChatClaimTypeAsync()
        {
            if (!await _identityClaimTypeRepository.AnyAsync(WeChatValidatorConsts.ClaimTypes.OpenId))
            {
                var wechatClaimType = new IdentityClaimType(_guidGenerator.Create(), WeChatValidatorConsts.ClaimTypes.OpenId,
                                                            isStatic: true, description: "适用于微信认证的用户标识");

                await _identityClaimTypeRepository.InsertAsync(wechatClaimType);
            }
        }