Browse Source

Merge pull request #3266 from abpframework/Cotur-Eto-IdentityServer

IdentityServer ETOs' added
pull/3269/head
Halil İbrahim Kalkan 7 years ago
committed by GitHub
parent
commit
18617afb1e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceEto.cs
  2. 84
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientEto.cs
  3. 22
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Devices/DeviceFlowCodesEto.cs
  4. 24
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantEto.cs
  5. 24
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceEto.cs
  6. 14
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs
  7. 7
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityServerAutoMapperProfile.cs

20
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceEto.cs

@ -0,0 +1,20 @@
using System;
using JetBrains.Annotations;
namespace Volo.Abp.IdentityServer.ApiResources
{
[Serializable]
public class ApiResourceEto
{
public Guid Id { get; set; }
[NotNull]
public string Name { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public bool Enabled { get; set; }
}
}

84
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientEto.cs

@ -0,0 +1,84 @@
using System;
namespace Volo.Abp.IdentityServer.Clients
{
[Serializable]
public class ClientEto
{
public Guid Id { get; set; }
public string ClientId { get; set; }
public string ClientName { get; set; }
public string Description { get; set; }
public string ClientUri { get; set; }
public string LogoUri { get; set; }
public bool Enabled { get; set; } = true;
public string ProtocolType { get; set; }
public bool RequireClientSecret { get; set; }
public bool RequireConsent { get; set; }
public bool AllowRememberConsent { get; set; }
public bool AlwaysIncludeUserClaimsInIdToken { get; set; }
public bool RequirePkce { get; set; }
public bool AllowPlainTextPkce { get; set; }
public bool AllowAccessTokensViaBrowser { get; set; }
public string FrontChannelLogoutUri { get; set; }
public bool FrontChannelLogoutSessionRequired { get; set; }
public string BackChannelLogoutUri { get; set; }
public bool BackChannelLogoutSessionRequired { get; set; }
public bool AllowOfflineAccess { get; set; }
public int IdentityTokenLifetime { get; set; }
public int AccessTokenLifetime { get; set; }
public int AuthorizationCodeLifetime { get; set; }
public int? ConsentLifetime { get; set; }
public int AbsoluteRefreshTokenLifetime { get; set; }
public int SlidingRefreshTokenLifetime { get; set; }
public int RefreshTokenUsage { get; set; }
public bool UpdateAccessTokenClaimsOnRefresh { get; set; }
public int RefreshTokenExpiration { get; set; }
public int AccessTokenType { get; set; }
public bool EnableLocalLogin { get; set; }
public bool IncludeJwtId { get; set; }
public bool AlwaysSendClientClaims { get; set; }
public string ClientClaimsPrefix { get; set; }
public string PairWiseSubjectSalt { get; set; }
public int? UserSsoLifetime { get; set; }
public string UserCodeType { get; set; }
public int DeviceCodeLifetime { get; set; }
}
}

22
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Devices/DeviceFlowCodesEto.cs

@ -0,0 +1,22 @@
using System;
namespace Volo.Abp.IdentityServer.Devices
{
[Serializable]
public class DeviceFlowCodesEto
{
public Guid Id { get; set; }
public string DeviceCode { get; set; }
public string UserCode { get; set; }
public string SubjectId { get; set; }
public string ClientId { get; set; }
public DateTime? Expiration { get; set; }
public string Data { get; set; }
}
}

24
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantEto.cs

@ -0,0 +1,24 @@
using System;
namespace Volo.Abp.IdentityServer.Grants
{
[Serializable]
public class PersistedGrantEto
{
public Guid Id { get; set; }
public string Key { get; set; }
public string Type { get; set; }
public string SubjectId { get; set; }
public string ClientId { get; set; }
public DateTime CreationTime { get; set; }
public DateTime? Expiration { get; set; }
public string Data { get; set; }
}
}

24
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/IdentityResources/IdentityResourceEto.cs

@ -0,0 +1,24 @@
using System;
namespace Volo.Abp.IdentityServer.IdentityResources
{
[Serializable]
public class IdentityResourceEto
{
public Guid Id { get; set; }
public string Name { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
public bool Enabled { get; set; }
public bool Required { get; set; }
public bool Emphasize { get; set; }
public bool ShowInDiscoveryDocument { get; set; }
}
}

14
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs

@ -6,7 +6,13 @@ using Microsoft.Extensions.Options;
using Volo.Abp.AutoMapper;
using Volo.Abp.BackgroundWorkers;
using Volo.Abp.Caching;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.Clients;
using Volo.Abp.IdentityServer.Devices;
using Volo.Abp.IdentityServer.Grants;
using Volo.Abp.IdentityServer.IdentityResources;
using Volo.Abp.IdentityServer.Tokens;
using Volo.Abp.Modularity;
using Volo.Abp.Security;
@ -34,6 +40,14 @@ namespace Volo.Abp.IdentityServer
options.AddProfile<IdentityServerAutoMapperProfile>(validate: true);
});
Configure<AbpDistributedEventBusOptions>(options =>
{
options.EtoMappings.Add<ApiResource, ApiResourceEto>(typeof(AbpIdentityServerDomainModule));
options.EtoMappings.Add<Client, ClientEto>(typeof(AbpIdentityServerDomainModule));
options.EtoMappings.Add<DeviceFlowCodes, DeviceFlowCodesEto>(typeof(AbpIdentityServerDomainModule));
options.EtoMappings.Add<IdentityResource, IdentityResourceEto>(typeof(AbpIdentityServerDomainModule));
});
AddIdentityServer(context.Services);
}

7
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityServerAutoMapperProfile.cs

@ -3,6 +3,7 @@ using System.Security.Claims;
using AutoMapper;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.Clients;
using Volo.Abp.IdentityServer.Devices;
using Volo.Abp.IdentityServer.Grants;
using Volo.Abp.IdentityServer.IdentityResources;
@ -82,6 +83,12 @@ namespace Volo.Abp.IdentityServer
CreateMap<ClientSecret, IdentityServer4.Models.Secret>(MemberList.Destination)
.ForMember(dest => dest.Type, opt => opt.Condition(srs => srs != null))
.ReverseMap();
CreateMap<ApiResource, ApiResourceEto>();
CreateMap<Client, ClientEto>();
CreateMap<DeviceFlowCodes, DeviceFlowCodesEto>();
CreateMap<PersistedGrant, PersistedGrantEto>();
CreateMap<IdentityResource, IdentityResourceEto>();
}
}
}

Loading…
Cancel
Save