Skip to content

HTTP security headers and cookies ​

Headers ​

HeaderWherePurpose
X-Content-Type-Options: nosniffAll responsesBrowsers do not run JSON as a script or page.
X-Frame-Options: DENY, CSP frame-ancestors 'none'All responsesNo clickjacking.
Referrer-Policy: no-referrerAll responsesCodes and Ids in URLs do not leak to other sites.
Content-Security-Policy: default-src 'none'; frame-ancestors 'none'; base-uri 'none'API responsesA response can never run as a page.
Own CSP, Cache-Control: no-storeSign-in, sign-out and consent pagesOnly Authora's own styles; pages with a Session or a pending authorization are not cached.
CSP default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; form-action 'self'; frame-ancestors 'none'; base-uri 'none'Admin interfaceNo inline or foreign scripts and styles.
Cross-Origin-Opener-Policy: same-originAdmin interfaceOther windows cannot reach it through window.opener.
Cache-Control: no-storeToken, revocation, introspection and UserInfo responses; admin session endpointsTokens are never cached.
Cache-Control: no-cacheAdmin interface filesBrowsers load the new version after an update.
Strict-Transport-Security: max-age=31536000All responses outside Development, except for localhostBrowsers only use HTTPS.

Plain HTTP requests are redirected to HTTPS when Kestrel knows the HTTPS port.

Cookies ​

All cookies use the __Host- prefix: they are Secure, have the path / and no Domain, so subdomains cannot set or read them.

CookieAttributesContent
__Host-authora_sessionHttpOnly, SameSite=Lax, no expiryThe Session token. The server enforces the idle timeout and the lifetime.
__Host-authora_antiforgeryHttpOnly, SameSite=StrictAntiforgery token of the sign-in, sign-out and consent forms.
__Host-authora_adminHttpOnly, SameSite=Strict, no expiryThe admin interface's Access and Refresh Token, encrypted with Data Protection.
__Host-authora_admin_signinHttpOnly, SameSite=Lax, 10 minutesstate and PKCE verifier of a running admin sign-in, encrypted.

Because the cookies are Secure and the antiforgery system refuses to issue its cookie over plain HTTP, the sign-in only works over HTTPS.

CORS ​

EndpointAllowed originsMethodsHeaders
/.well-known/openid-configuration, /.well-known/jwks.jsonAnyGET–
/oauth/token, /oauth/revokeOrigins of the Redirect URIs of enabled ClientsPOSTContent-Type
/oauth/userinfoOrigins of the Redirect URIs of enabled ClientsGET, POSTAuthorization
everything else, including /oauth/introspect, /oauth/authorize, /account/*, /api/*none

No endpoint allows credentials (cookies) in cross-origin requests.

Released under the MIT License.