Ejemplo n.º 1
0
        public static void UpdateEntity(this Models.IdentityProvider idp, Entities.IdentityProvider entity)
        {
            if (idp == null || entity == null)
            {
                return;
            }

            entity.Id = idp.ID;
            entity.Name = idp.Name;
            entity.Enabled = idp.Enabled;
            entity.ShowInHrdSelection = idp.ShowInHrdSelection;
            entity.DisplayName = idp.DisplayName;
            entity.Type = (int)idp.Type;
            entity.WSFederationEndpoint = idp.WSFederationEndpoint;
            entity.IssuerThumbprint = idp.IssuerThumbprint;
            entity.ClientID = idp.ClientID;
            entity.ClientSecret = idp.ClientSecret;
            entity.OAuth2ProviderType = (int?)idp.ProviderType;
        }
Ejemplo n.º 2
0
 public static void UpdateEntity(this Models.Client client, Entities.Client target)
 {
     target.Id = client.ID;
     target.ClientId = client.ClientId;
     if (!String.IsNullOrWhiteSpace(client.ClientSecret))
     {
         target.ClientSecret = CryptoHelper.HashPassword(client.ClientSecret);
     }
     target.Description = client.Description;
     target.Name = client.Name;
     target.RedirectUri = client.RedirectUri != null ? client.RedirectUri.AbsoluteUri : null;
     //target.AllowRefreshToken = client.AllowRefreshToken;
     target.AllowRefreshToken = true;
     target.AllowResourceOwnerFlow = client.AllowResourceOwnerFlow;
     target.AllowImplicitFlow = client.AllowImplicitFlow;
     target.AllowCodeFlow = client.AllowCodeFlow;
 }