ProfileService.cs 751 B

1234567891011121314151617181920212223242526
  1. using IdentityServer4.Models;
  2. using IdentityServer4.Services;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. namespace QM.AuthServer.Auth
  8. {
  9. public class ProfileService : IProfileService
  10. {
  11. public async Task GetProfileDataAsync(ProfileDataRequestContext context)
  12. {
  13. var claims = context.Subject.Claims.ToList();
  14. context.IssuedClaims = claims.ToList();
  15. //foreach (var item in claims)
  16. //{
  17. // context.Client.Claims.Add(new ClientClaim(item.Type, item.Value));
  18. //}
  19. }
  20. public async Task IsActiveAsync(IsActiveContext context)
  21. {
  22. context.IsActive = true;
  23. }
  24. }
  25. }