-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
280 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
src/ZNetCS.AspNetCore.Authentication.Basic/BasicAuthenticationExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="BasicAuthenticationExtensions.cs" company="Marcin Smółka zNET Computer Solutions"> | ||
// Copyright (c) Marcin Smółka zNET Computer Solutions. All rights reserved. | ||
// </copyright> | ||
// <summary> | ||
// The basic authentication extensions. | ||
// </summary> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace ZNetCS.AspNetCore.Authentication.Basic | ||
{ | ||
#region Usings | ||
|
||
using System; | ||
|
||
using Microsoft.AspNetCore.Authentication; | ||
|
||
#endregion | ||
|
||
/// <summary> | ||
/// The basic authentication extensions. | ||
/// </summary> | ||
public static class BasicAuthenticationExtensions | ||
{ | ||
#region Public Methods | ||
|
||
/// <summary> | ||
/// Adds basic authentication. | ||
/// </summary> | ||
/// <param name="builder"> | ||
/// The authentication builder. | ||
/// </param> | ||
public static AuthenticationBuilder AddBasicAuthentication(this AuthenticationBuilder builder) | ||
{ | ||
return builder.AddBasicAuthentication(BasicAuthenticationDefaults.AuthenticationScheme); | ||
} | ||
|
||
/// <summary> | ||
/// Adds basic authentication. | ||
/// </summary> | ||
/// <param name="builder"> | ||
/// The authentication builder. | ||
/// </param> | ||
/// <param name="authenticationScheme"> | ||
/// The authentication scheme. | ||
/// </param> | ||
public static AuthenticationBuilder AddBasicAuthentication(this AuthenticationBuilder builder, string authenticationScheme) | ||
{ | ||
return builder.AddBasicAuthentication(authenticationScheme, null); | ||
} | ||
|
||
/// <summary> | ||
/// Adds basic authentication. | ||
/// </summary> | ||
/// <param name="builder"> | ||
/// The authentication builder. | ||
/// </param> | ||
/// <param name="configureOptions"> | ||
/// The configure options. | ||
/// </param> | ||
public static AuthenticationBuilder AddBasicAuthentication(this AuthenticationBuilder builder, Action<BasicAuthenticationOptions> configureOptions) | ||
{ | ||
return builder.AddBasicAuthentication(BasicAuthenticationDefaults.AuthenticationScheme, configureOptions); | ||
} | ||
|
||
/// <summary> | ||
/// Adds basic authentication. | ||
/// </summary> | ||
/// <param name="builder"> | ||
/// The builder. | ||
/// </param> | ||
/// <param name="authenticationScheme"> | ||
/// The authentication scheme. | ||
/// </param> | ||
/// <param name="configureOptions"> | ||
/// The configure options. | ||
/// </param> | ||
public static AuthenticationBuilder AddBasicAuthentication( | ||
this AuthenticationBuilder builder, | ||
string authenticationScheme, | ||
Action<BasicAuthenticationOptions> configureOptions) | ||
{ | ||
return builder.AddScheme<BasicAuthenticationOptions, BasicAuthenticationHandler>(authenticationScheme, configureOptions); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 0 additions & 62 deletions
62
src/ZNetCS.AspNetCore.Authentication.Basic/BasicAuthenticationMiddleware.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.