Пример #1
0
        private async Task AddClaimTypes()
        {
            var ageClaim = new IdentityClaimType(_testData.AgeClaimId, "Age", false, false, null, null, null, IdentityClaimValueType.Int);
            await _identityClaimTypeRepository.InsertAsync(ageClaim);

            var educationClaim = new IdentityClaimType(_testData.EducationClaimId, "Education", true, false, null, null, null);
            await _identityClaimTypeRepository.InsertAsync(educationClaim);
        }
Пример #2
0
        private async Task AddClaimTypes()
        {
            var ageClaim = new IdentityClaimType(Guid.NewGuid(), "Age", false, false, null, null, null, IdentityClaimValueType.Int);
            await _identityClaimTypeRepository.InsertAsync(ageClaim);

            var educationClaim = new IdentityClaimType(Guid.NewGuid(), "Education", true, false, null, null, null);
            await _identityClaimTypeRepository.InsertAsync(educationClaim);

            var taitansClaim = new IdentityClaimType(Guid.NewGuid(), "Taitans", true, false, null, null, null, IdentityClaimValueType.DateTime);
            await _identityClaimTypeRepository.InsertAsync(taitansClaim);
        }
Пример #3
0
        public async Task Static_IdentityClaimType_Cant_Not_Update()
        {
            var phoneClaim = new IdentityClaimType(Guid.NewGuid(), "Phone", true, true);
            await _identityClaimTypeRepository.InsertAsync(phoneClaim);

            await Assert.ThrowsAnyAsync <AbpException>(async() => await _claimTypeManager.UpdateAsync(phoneClaim));
        }
Пример #4
0
        public async Task <IdentityClaimType> CreateAsync(IdentityClaimType claimType)
        {
            if (await _identityClaimTypeRepository.DoesNameExist(claimType.Name))
            {
                throw new AbpException($"Name Exist: {claimType.Name}");
            }

            return(await _identityClaimTypeRepository.InsertAsync(claimType));
        }
Пример #5
0
        public virtual async Task <IdentityClaimType> CreateAsync(IdentityClaimType claimType)
        {
            if (await _identityClaimTypeRepository.AnyAsync(claimType.Name).ConfigureAwait(false))
            {
                throw new AbpException($"Name Exist: {claimType.Name}");
            }

            return(await _identityClaimTypeRepository.InsertAsync(claimType).ConfigureAwait(false));
        }
Пример #6
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);
            }
        }
 private async Task AddClaimTypes()
 {
     var ageClaim = new IdentityClaimType(Guid.NewGuid(), "Age", false, false, null, null, null,
                                          IdentityClaimValueType.Int);
     await _identityClaimTypeRepository.InsertAsync(ageClaim);
 }