Exemple #1
0
        public Task GetProfileDataAsync(ProfileDataRequestContext context)
        {
            try
            {
                // Retrieve subject
                var subjectId = context.Subject.GetSubjectId();

                // Retrieve user by id
                var user = DbContext.GetUserById(subjectId);

                // Set claims for user
                context.IssuedClaims = DbContext
                                       .GetUserClaimsByUserId(user.UserId)
                                       .Select(item => new Claim(item.ClaimType, item.ClaimValue))
                                       .ToList();

                return(Task.FromResult(0));
            }
            catch
            {
                return(Task.FromResult(0));
            }
        }