/* * 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 JetBrains.Annotations; using Microsoft.IdentityModel.Protocols.OpenIdConnect; using Microsoft.IdentityModel.Tokens; namespace OpenIddict.Validation { public static partial class OpenIddictValidationEvents { /// /// Represents an event called for each request to the configuration endpoint /// to give the user code a chance to add parameters to the configuration request. /// public class PrepareConfigurationRequestContext : BaseExternalContext { /// /// Creates a new instance of the class. /// public PrepareConfigurationRequestContext([NotNull] OpenIddictValidationTransaction transaction) : base(transaction) { } } /// /// Represents an event called for each request to the configuration endpoint /// to send the configuration request to the remote authorization server. /// public class ApplyConfigurationRequestContext : BaseExternalContext { /// /// Creates a new instance of the class. /// public ApplyConfigurationRequestContext([NotNull] OpenIddictValidationTransaction transaction) : base(transaction) { } } /// /// Represents an event called for each configuration response /// to extract the response parameters from the server response. /// public class ExtractConfigurationResponseContext : BaseExternalContext { /// /// Creates a new instance of the class. /// public ExtractConfigurationResponseContext([NotNull] OpenIddictValidationTransaction transaction) : base(transaction) { } } /// /// Represents an event called for each validated configuration response. /// public class HandleConfigurationResponseContext : BaseExternalContext { /// /// Creates a new instance of the class. /// public HandleConfigurationResponseContext([NotNull] OpenIddictValidationTransaction transaction) : base(transaction) { } /// /// Gets the OpenID Connect configuration. /// public OpenIdConnectConfiguration Configuration { get; } = new OpenIdConnectConfiguration(); } /// /// Represents an event called for each request to the cryptography endpoint /// to give the user code a chance to add parameters to the cryptography request. /// public class PrepareCryptographyRequestContext : BaseExternalContext { /// /// Creates a new instance of the class. /// public PrepareCryptographyRequestContext([NotNull] OpenIddictValidationTransaction transaction) : base(transaction) { } } /// /// Represents an event called for each request to the cryptography endpoint /// to send the cryptography request to the remote authorization server. /// public class ApplyCryptographyRequestContext : BaseExternalContext { /// /// Creates a new instance of the class. /// public ApplyCryptographyRequestContext([NotNull] OpenIddictValidationTransaction transaction) : base(transaction) { } } /// /// Represents an event called for each cryptography response /// to extract the response parameters from the server response. /// public class ExtractCryptographyResponseContext : BaseExternalContext { /// /// Creates a new instance of the class. /// public ExtractCryptographyResponseContext([NotNull] OpenIddictValidationTransaction transaction) : base(transaction) { } } /// /// Represents an event called for each validated cryptography response. /// public class HandleCryptographyResponseContext : BaseExternalContext { /// /// Creates a new instance of the class. /// public HandleCryptographyResponseContext([NotNull] OpenIddictValidationTransaction transaction) : base(transaction) { } /// /// Gets the security keys. /// public JsonWebKeySet SecurityKeys { get; } = new JsonWebKeySet(); } } }