/*
* 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.ComponentModel;
using OpenIddict.Validation.ServerIntegration;
namespace Microsoft.Extensions.DependencyInjection;
///
/// Exposes the necessary methods required to configure the OpenIddict validation services.
///
public class OpenIddictValidationServerIntegrationBuilder
{
///
/// Initializes a new instance of .
///
/// The services collection.
public OpenIddictValidationServerIntegrationBuilder(IServiceCollection services)
=> Services = services ?? throw new ArgumentNullException(nameof(services));
///
/// Gets the services collection.
///
[EditorBrowsable(EditorBrowsableState.Never)]
public IServiceCollection Services { get; }
///
/// Amends the default OpenIddict validation/server integration configuration.
///
/// The delegate used to configure the OpenIddict options.
/// This extension can be safely called multiple times.
/// The .
public OpenIddictValidationServerIntegrationBuilder Configure(Action configuration)
{
if (configuration is null)
{
throw new ArgumentNullException(nameof(configuration));
}
Services.Configure(configuration);
return this;
}
///
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object? obj) => base.Equals(obj);
///
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => base.GetHashCode();
///
[EditorBrowsable(EditorBrowsableState.Never)]
public override string? ToString() => base.ToString();
}