Esempio n. 1
0
        //
        // Summary:
        //     Returns the linked accounts for this user
        //
        // Parameters:
        //   user:
        public async Task <IList <UserLoginInfo> > GetLoginsAsync(TUser user)
        {
            List <UserLoginInfo> res = new List <UserLoginInfo>();

            foreach (var userLogin in await m_userLoginTable.FindByPartitionKeyAsync <UserLogin>(user.Id))
            {
                res.Add(new UserLoginInfo(userLogin.LoginProvider, userLogin.ProviderKey));
            }
            return(res);
        }
Esempio n. 2
0
        //
        // Summary:
        //     Returns the roles for this user
        //
        // Parameters:
        //   user:
        public async Task <IList <string> > GetRolesAsync(TUser user)
        {
            var userRoles = await m_userRoleTable.FindByPartitionKeyAsync <UserRole>(user.Id);

            return(userRoles.Select(r => r.RoleName).ToList());
        }
Esempio n. 3
0
        //
        // Summary:
        //     Returns the claims for the user with the issuer set
        //
        // Parameters:
        //   user:
        public async Task <IList <Claim> > GetClaimsAsync(TUser user)
        {
            var claims = await m_userClaimTable.FindByPartitionKeyAsync <UserClaim>(user.Id);

            return(claims.Select(c => new Claim(c.ClaimType, c.ClaimValue)).ToList());
        }