This commit is contained in:
2026-10-14 17:33:24 +03:30
parent 4d2193c3b9
commit 8bbd047e93
6 changed files with 49 additions and 254 deletions
-45
View File
@@ -25,9 +25,7 @@ using xIdentityModels.Configurations;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore.Authentication;
using Microsoft.Extensions.DependencyInjection;
using xIdentityService.Constants;
namespace xIds.DI
{
@@ -412,49 +410,6 @@ namespace xIds.DI
// Create Authentication Builder ...
var authBuilder = services.AddAuthentication();
//
// Create Authentication Builder ...
// var authBuilder = services.AddAuthentication(options =>
// {
// //
// // Setting Default Authentication Schema ...
// // For Handling Smart Schema Forwarder ...
// options.DefaultScheme = XAuthentication.SMART_SCHEME;
// options.DefaultChallengeScheme = XAuthentication.SMART_SCHEME;
// options.DefaultAuthenticateScheme = XAuthentication.SMART_SCHEME;
// })
// .AddPolicyScheme(
// displayName: XAuthentication.SMART_SCHEME,
// authenticationScheme: XAuthentication.SMART_SCHEME,
// configureOptions: options =>
// {
// //
// // Configure Forward Default Selector ...
// options.ForwardDefaultSelector = context =>
// {
// //
// // Retrieve XApiKey Header Key ...
// var apiKeyHeader = XHeader.ApiKey.GetStringValue();
// //
// // If Header Contains Key ...
// if (context.Request.Headers.ContainsKey(apiKeyHeader))
// {
// return XAuthenticationScheme.XApiKey.GetStringValue();
// }
// //
// // If not ...
// return XAuthentication.IDENTITY_SERVER_LOCAL_API;
// };
// }
// );
//
// authBuilder.AddScheme<AuthenticationSchemeOptions, XApiKeyAuthenticationHandler>(
// XAuthenticationScheme.XApiKey.GetStringValue(),
// options => { });
//
// Add JwtBearer by Smart Schema ForwardDefaultSelector ...
authBuilder.AddJwtBearer(options =>