Table of Contents

Class CorsOptions

Namespace
Fdyay.IdentityServer.Configuration
Assembly
Fdyay.IdentityServer.Core.dll

CORS settings for the protocol endpoints.

public class CorsOptions
Inheritance
CorsOptions
Inherited Members

Properties

CorsPaths

The protocol endpoint paths CORS is applied to, relative and without a leading slash.

public ICollection<string> CorsPaths { get; set; }

Property Value

ICollection<string>

Remarks

Defaults to the endpoints a browser-based client calls directly: discovery and its key set, user info, token and revocation. Authorize and end session are absent because a browser reaches them by navigation rather than by script, and introspection because it is a resource server's call, not a browser's.

These are the values in ProtocolRoutePaths. They are spelled out here because the paths live in the hosting assembly and these options do not depend on it; a test asserts the two agree.

CorsPolicyName

The name of the ASP.NET Core CORS policy evaluated for protocol endpoint requests.

public string CorsPolicyName { get; set; }

Property Value

string

Remarks

The policy decides which origins are allowed by asking the registered ICorsPolicyService. Register a different implementation of that to change the answer, rather than redefining a policy under this name.

PreflightCacheDuration

The Access-Control-Max-Age value sent on preflight responses.

public TimeSpan? PreflightCacheDuration { get; set; }

Property Value

TimeSpan?

Remarks

Null by default, which emits no header and leaves the preflight cache duration to the browser.