public class AssemblyPairOptions
ApiAssembly
DomainAssembly
string ToString()
Copy and fill out the AzureAd section into the project User Secrets.
Code usage:
{ "Authorization": { /* This will be used to set the Authority on the JWT bearer options - 'https://login.microsoftonline.com' (For Azure AD) - 'https://adfs1.some.organization.com' (For on-prem ADFS) */ "Instance": "https://login.microsoftonline.com", "ClientId": "[Application ID of the Azure AD App Registration]", /* You need specify the TenantId only if you want to accept access tokens from a single tenant (line-of-business app). Otherwise, you can leave them set to common. This can be: - A GUID (Tenant ID = Directory ID) - 'common' (any organization and personal accounts) - 'organizations' (any organization) - 'consumers' (Microsoft personal accounts) - 'adfs' (For on-prem ADFS) */ "TenantId": "common", "Audience": "[App Identifier URI of the Azure AD App Registration]" "Issuer": "[The token iss claim also specified as the access_token_issuer from the OpenID configuration]" "ValidAudiences": ["A", "collection", "of", "app", "identifier", "URIs"] } }
public class AuthorizationOptions
string ConfigurationSectionName
Audience
ClientId
Instance
Issuer
TenantId
ValidAudiences
ValidIssuers
bool IsSecurityEnabled()
public class ConfigureApiBehaviorOptions : IConfigureOptions<ApiBehaviorOptions>
void Configure(ApiBehaviorOptions options)
public class RequestResponseLoggerOptions
DefaultLogLevelSummary: Gets or sets the default log level for the logger.
IncludeRequestHeaderParametersSummary: Gets or sets a value indicating whether request header parameters should be included in logs.
IncludeRequestQueryParametersSummary: Gets or sets a value indicating whether request query parameters should be included in logs.
IncludeResponseBodySummary: Gets or sets a value indicating whether the response body should be logged.
Remarks: Logging the response body can be useful for debugging responses but may increase the size of log files.
IncludeResponseHeaderParametersSummary: Gets or sets a value indicating whether response header parameters should be included in logs.
SkipSignalrRequestsSummary: Gets or sets a value indicating whether SignalR requests should be exempt from logging.
Remarks: Skipping SignalR requests can reduce noise in logs from real-time communications.
SkipSwaggerRequestsSummary: Gets or sets a value indicating whether Swagger requests should be exempt from logging.
Remarks: Skipping Swagger requests can reduce noise in logs from automated or development-time API exploration.
string ToString()
public class RestApiOptions
AllowAnonymousAccessForDevelopment
AssemblyPairs
Authorization
EnableRequestResponseLogger
ErrorHandlingExceptionFilter
JsonSerializerCasingStyle
RequestResponseLoggerOptions
UseApplicationInsights
UseAutoRegistrateServices
UseEnumAsStringInSerialization
UseHttpContextAccessor
UseJsonSerializerOptionsIgnoreNullValues
UseRequireHttpsPermanent
UseValidateServiceRegistrations
void AddAssemblyPairs(Assembly apiAssembly, Assembly domainAssembly)
public class RestApiOptionsErrorHandlingExceptionFilter
Enable
IncludeExceptionDetails
UseProblemDetailsAsResponseBody