/* * Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) * See https://github.com/openiddict/openiddict-core for more information concerning * the license and the contributors participating to this project. */ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; namespace OpenIddict.EntityFramework.Models; /// /// Represents an OpenIddict application. /// public class OpenIddictEntityFrameworkApplication : OpenIddictEntityFrameworkApplication { public OpenIddictEntityFrameworkApplication() { // Generate a new string identifier. Id = Guid.NewGuid().ToString(); } } /// /// Represents an OpenIddict application. /// [DebuggerDisplay("Id = {Id.ToString(),nq} ; ClientId = {ClientId,nq} ; ClientType = {ClientType,nq}")] public class OpenIddictEntityFrameworkApplication where TKey : notnull, IEquatable where TAuthorization : class where TToken : class { /// /// Gets or sets the application type associated with the current application. /// public virtual string? ApplicationType { get; set; } /// /// Gets the list of the authorizations associated with this application. /// public virtual ICollection Authorizations { get; } = new HashSet(); /// /// Gets or sets the client identifier associated with the current application. /// public virtual string? ClientId { get; set; } /// /// Gets or sets the client secret associated with the current application. /// Note: depending on the application manager used to create this instance, /// this property may be hashed or encrypted for security reasons. /// public virtual string? ClientSecret { get; set; } /// /// Gets or sets the client type associated with the current application. /// public virtual string? ClientType { get; set; } /// /// Gets or sets the concurrency token. /// public virtual string? ConcurrencyToken { get; set; } = Guid.NewGuid().ToString(); /// /// Gets or sets the consent type associated with the current application. /// public virtual string? ConsentType { get; set; } /// /// Gets or sets the display name associated with the current application. /// public virtual string? DisplayName { get; set; } /// /// Gets or sets the localized display names /// associated with the current application, /// serialized as a JSON object. /// [StringSyntax(StringSyntaxAttribute.Json)] public virtual string? DisplayNames { get; set; } /// /// Gets or sets the unique identifier associated with the current application. /// public virtual TKey? Id { get; set; } /// /// Gets or sets the permissions associated with the /// current application, serialized as a JSON array. /// [StringSyntax(StringSyntaxAttribute.Json)] public virtual string? Permissions { get; set; } /// /// Gets or sets the post-logout redirect URIs associated with /// the current application, serialized as a JSON array. /// [StringSyntax(StringSyntaxAttribute.Json)] public virtual string? PostLogoutRedirectUris { get; set; } /// /// Gets or sets the additional properties serialized as a JSON object, /// or if no bag was associated with the current application. /// [StringSyntax(StringSyntaxAttribute.Json)] public virtual string? Properties { get; set; } /// /// Gets or sets the redirect URIs associated with the /// current application, serialized as a JSON array. /// [StringSyntax(StringSyntaxAttribute.Json)] public virtual string? RedirectUris { get; set; } /// /// Gets or sets the requirements associated with the /// current application, serialized as a JSON array. /// [StringSyntax(StringSyntaxAttribute.Json)] public virtual string? Requirements { get; set; } /// /// Gets the list of the tokens associated with this application. /// public virtual ICollection Tokens { get; } = new HashSet(); }