Class InMemoryCorsPolicyService
- Namespace
- Fdyay.IdentityServer.Services
- Assembly
- Fdyay.IdentityServer.Core.dll
Allows the origins the registered clients declare in AllowedCorsOrigins.
public class InMemoryCorsPolicyService : ICorsPolicyService
- Inheritance
-
InMemoryCorsPolicyService
- Implements
- Inherited Members
Constructors
InMemoryCorsPolicyService(ILogger<InMemoryCorsPolicyService>, IEnumerable<Client>)
A policy service over clients.
public InMemoryCorsPolicyService(ILogger<InMemoryCorsPolicyService> logger, IEnumerable<Client> clients)
Parameters
loggerILogger<InMemoryCorsPolicyService>Where each decision is logged.
clientsIEnumerable<Client>The registered clients, whose enabled ones' AllowedCorsOrigins are allowed.
Methods
IsOriginAllowedAsync(string, CancellationToken)
Returns true if the origin is allowed.
public Task<bool> IsOriginAllowedAsync(string origin, CancellationToken cancellationToken = default)
Parameters
originstringcancellationTokenCancellationToken
Returns
Remarks
Compares origins ignoring case; a disabled client's origins are not allowed.