/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers
* for more information concerning the license and the contributors participating to this project.
*/
using JetBrains.Annotations;
using Microsoft.AspNetCore.Authentication;
namespace Yi.Framework.AspNetCore.Authentication.OAuth.Gitee;
///
/// Extension methods to add Gitee authentication capabilities to an HTTP application pipeline.
///
public static class GiteeAuthenticationExtensions
{
///
/// Adds to the specified
/// , which enables Gitee authentication capabilities.
///
/// The authentication builder.
/// The .
public static AuthenticationBuilder AddGitee([NotNull] this AuthenticationBuilder builder)
{
return builder.AddGitee(GiteeAuthenticationDefaults.AuthenticationScheme, options => { });
}
///
/// Adds to the specified
/// , which enables Gitee authentication capabilities.
///
/// The authentication builder.
/// The delegate used to configure the OpenID 2.0 options.
/// The .
public static AuthenticationBuilder AddGitee(
[NotNull] this AuthenticationBuilder builder,
[NotNull] Action configuration)
{
return builder.AddGitee(GiteeAuthenticationDefaults.AuthenticationScheme, configuration);
}
///
/// Adds to the specified
/// , which enables Gitee authentication capabilities.
///
/// The authentication builder.
/// The authentication scheme associated with this instance.
/// The delegate used to configure the Gitee options.
/// The .
public static AuthenticationBuilder AddGitee(
[NotNull] this AuthenticationBuilder builder,
[NotNull] string scheme,
[NotNull] Action configuration)
{
return builder.AddGitee(scheme, GiteeAuthenticationDefaults.DisplayName, configuration);
}
///
/// Adds to the specified
/// , which enables Gitee authentication capabilities.
///
/// The authentication builder.
/// The authentication scheme associated with this instance.
/// The optional display name associated with this instance.
/// The delegate used to configure the Gitee options.
/// The .
public static AuthenticationBuilder AddGitee(
[NotNull] this AuthenticationBuilder builder,
[NotNull] string scheme,
[CanBeNull] string caption,
[NotNull] Action configuration)
{
return builder.AddScheme(scheme, caption, configuration);
}
}