public IdentityServer4.Models.Client ToModel() { return(new IdentityServer4.Models.Client { AbsoluteRefreshTokenLifetime = AbsoluteRefreshTokenLifetime, AccessTokenLifetime = AccessTokenLifetime, AccessTokenType = AccessTokenType, AllowAccessTokensViaBrowser = AllowAccessTokensViaBrowser, AllowedCorsOrigins = AllowedCorsOrigins, AllowedGrantTypes = AllowedGrantTypes, AllowedScopes = AllowedScopes, AllowOfflineAccess = AllowOfflineAccess, AllowPlainTextPkce = AllowPlainTextPkce, AllowRememberConsent = AllowRememberConsent, AlwaysIncludeUserClaimsInIdToken = AlwaysIncludeUserClaimsInIdToken, AlwaysSendClientClaims = AlwaysSendClientClaims, AuthorizationCodeLifetime = AuthorizationCodeLifetime, BackChannelLogoutSessionRequired = BackChannelLogoutSessionRequired, BackChannelLogoutUri = BackChannelLogoutUri, Claims = Claims.Select(c => new Claim(c.Key, c.Value)).ToList(), ClientClaimsPrefix = ClientClaimsPrefix, ClientId = ClientId, ClientName = ClientName, ClientSecrets = ClientSecrets.Select(c => new IdentityServer4.Models.Secret { Type = c.Type, Description = c.Description, Expiration = c.Expiration, Value = c.Value.ToSha256() }).ToList(), ClientUri = ClientUri, ConsentLifetime = ConsentLifetime, Description = Description, DeviceCodeLifetime = DeviceCodeLifetime, Enabled = Enabled, EnableLocalLogin = EnableLocalLogin, FrontChannelLogoutSessionRequired = FrontChannelLogoutSessionRequired, FrontChannelLogoutUri = FrontChannelLogoutUri, IdentityProviderRestrictions = IdentityProviderRestrictions, IdentityTokenLifetime = IdentityTokenLifetime, IncludeJwtId = IncludeJwtId, LogoUri = LogoUri, PairWiseSubjectSalt = PairWiseSubjectSalt, PostLogoutRedirectUris = PostLogoutRedirectUris, Properties = Properties, ProtocolType = ProtocolType, RedirectUris = RedirectUris, RefreshTokenExpiration = RefreshTokenExpiration, RefreshTokenUsage = RefreshTokenUsage, RequireClientSecret = RequireClientSecret, RequireConsent = RequireConsent, RequirePkce = RequirePkce, SlidingRefreshTokenLifetime = SlidingRefreshTokenLifetime, UpdateAccessTokenClaimsOnRefresh = UpdateAccessTokenClaimsOnRefresh, UserCodeType = UserCodeType, UserSsoLifetime = UserSsoLifetime }); }
/// <summary> /// returns this class converted to IdentityServer4.Models.Client /// </summary> /// <returns></returns> public IdentityServer4.Models.Client ToClient() { return(new IdentityServer4.Models.Client { ClientId = ClientId, ClientName = ClientName, ClientUri = ClientUri, LogoUri = LogoUri, ClientSecrets = ClientSecrets.Select(cs => new IdentityServer4.Models.Secret(cs.Value.Sha256(), cs.Description, cs.Expiration)).ToList(), AllowedScopes = AllowedScopes, AllowedGrantTypes = AllowedGrantTypes, AllowAccessTokensViaBrowser = AllowAccessTokensViaBrowser, RedirectUris = RedirectUris ?? new List <string>(), PostLogoutRedirectUris = PostLogoutRedirectUris ?? new List <string>(), AllowedCorsOrigins = AllowedCorsOrigins, AllowOfflineAccess = AllowOfflineAccess, AccessTokenType = AccessTokenType, AccessTokenLifetime = AccessTokenLifetime, Enabled = Enabled, RequireConsent = RequireConsent }); }