Authentication, Sessions, WAF, and CORS
Use the endpoint matching your authentication mode: HttpApiUrl for JWT, IamApiUrl for AWS SigV4, and KeyApiUrl for FormKiQ API keys. Changing the URL does not add signing or transform one credential type into another. See Security.
Cognito token lifetimes
The v1.19.2 root template exposes these settings for its Cognito client:
| Parameter | Default | Allowed range | Applies to |
|---|---|---|---|
TokenAccessIdValidityMinutes | 1440 minutes (24 hours) | 5–1440 minutes | Access and ID tokens. |
TokenRefreshValidityMinutes | 43200 minutes (30 days) | 60–5256000 minutes | Refresh token. |
These are shipped template defaults, not an organization-wide session policy. Inspect the deployed Cognito app client for the effective values and units. Custom JWT issuers and SSO providers have their own lifetimes and session controls. Nested Cognito settings are wired from the root; do not independently update a child stack managed by the parent.
Send the AccessToken to the JWT API. The ID token describes the user's authenticated identity; the refresh token obtains replacement tokens. Do not send a refresh token to a document endpoint. Use JWT Authentication Token for the login flow.
Web sessions and renewal
FormKiQ Web v4.3.8 warns before session expiry and offers Renew session. Successful renewal depends on a valid refresh session and the configured identity provider. An open browser tab is not proof of a valid token, and the token lifetime is not a documented inactivity timeout.
Test refresh, expired tokens, account disablement, group changes, and sign-out with the same issuer/client used in production. Long-running integrations must deliberately renew or reacquire credentials; the MCP server, for example, requires a refreshed token and restart rather than automatic renewal.
If rapid permission revocation is required, combine shorter token lifetimes with the identity provider's session controls and backend authorization strategy. API JWT validation does not necessarily consult a Cognito revocation list for every request. Removing a group or disabling a user must not be described as instant invalidation of every previously issued JWT or presigned content URL.
WAF coverage
ConsoleWafACLId associates a Web ACL with the console CloudFront distribution. It does not protect every regional API endpoint merely because the browser calls them.
AWS supports WAF association with CloudFront distributions and API Gateway REST APIs; the default FormKiQ HTTP APIs are a different API Gateway product. For an API WAF boundary, design a supported front door and explicitly prevent bypass through an unprotected origin or alternate hostname. A WAF rule on a distribution alone is not proof that direct API-origin calls are blocked. AWS WAF supported resources.
For CloudFront, create the Web ACL in the required global/us-east-1 scope. Test rules in count mode, then enforce the reviewed rules. Include uploads, presigned S3 transfers, identity-provider redirects, and API calls in testing so a console rule is not mistaken for end-to-end coverage. Monitor blocked requests without storing sensitive bodies.
CORS
CORS tells browsers which origins can read cross-origin responses. It is not authentication and does not stop server-side clients. An Origin allowlist never replaces permission checks.
The release includes permissive CORS settings in storage/API components. Review both boundaries when embedding FormKiQ in your own web application:
- API preflight and responses must allow the intended application origins, methods, and authorization/content headers.
- Presigned uploads go directly to S3 and need the bucket's allowed origin/method/header rules, including any signed checksum or encryption headers.
- Expose response headers, such as ETag, only when the client actually needs them.
- Credentialed browser requests need an explicit origin rather than a wildcard response. Do not add cookies or credentials to an integration without checking the complete CORS policy.
Manage changes through the owning infrastructure template or approved overlay; manual console edits can be overwritten by upgrades. Verify a permitted origin, a disallowed origin, preflight requests, and a direct non-browser request. The last one should still require authentication regardless of its Origin header.
Deployment acceptance
Record issuer, audience/client, endpoint mode, token lifetimes, effective browser session behavior, WAF-protected resources, origin bypass tests, and allowed origins. Run the regulated production checklist when those controls support a regulated workload.