public ClientSecret buildClientSecret(SecretBindingDto dto)
 {
     return(new ClientSecret {
         ClientId = dto.ResourceId,
         Type = "SharedSecret",
         Value = dto.value.Sha256(),
         Created = DateTime.Now,
         Description = dto.Description
     });
 }
예제 #2
0
        public string AddSecret(SecretBindingDto dto)
        {
            string response = "";

            if (dto.AudienceType == "ApiResource")
            {
                response = _repo.AddApiSecret(_factory.buildApiSecret(dto));
            }
            else
            {
                response = _repo.AddClientSecret(_factory.buildClientSecret(dto));
            }
            return(response);
        }