34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using GerstITS.Web.Api.Swagger;
|
|
using Microsoft.Net.Http.Headers;
|
|
using Microsoft.OpenApi.Models;
|
|
|
|
namespace GerstITS.Examples.Api.Configurations
|
|
{
|
|
internal sealed class OpenApiSecuritySchemeConfiguration : IOpenApiSecuritySchemeConfiguration
|
|
{
|
|
#region Properties
|
|
|
|
public bool AllowAnonymous { get; }
|
|
public string HttpHeaderKey { get; }
|
|
public string Scheme { get; }
|
|
public SecuritySchemeType SchemeType { get; }
|
|
public ParameterLocation ParameterLocation { get; }
|
|
public string Description { get; }
|
|
|
|
#endregion
|
|
|
|
#region Constructors
|
|
|
|
public OpenApiSecuritySchemeConfiguration()
|
|
{
|
|
AllowAnonymous = false;
|
|
HttpHeaderKey = HeaderNames.Authorization;
|
|
Scheme = "Bearer";
|
|
SchemeType = SecuritySchemeType.Http;
|
|
ParameterLocation = ParameterLocation.Header;
|
|
Description = "Authorization header using the Bearer scheme (Value: Bearer {{access_token}}).";
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |