Cross-Origin Resource Sharing (CORS) Configuration
Control cross-origin access, security policies, and browser compatibility settings
Allowed Origins
Allowed Origins define which domains are permitted to make cross-origin requests to your IdentitySuite server. This is the primary security control for CORS and determines which client applications can access your authentication services.
Origin Configuration:
https://app.example.com is different from
http://app.example.com or https://example.com.
http://localhost:3000) but remove them in production environments
for security.
Security Best Practices:
- • Never use wildcards (*) in production - specify exact domains
- • Remove development origins (localhost) from production configurations
- • Regularly audit and remove unused origins
- • Use HTTPS origins whenever possible for secure communication
Common Configuration Examples:
Allowed Headers
Allowed Headers specify which HTTP headers client applications can include in their cross-origin requests. These headers are essential for authentication, content negotiation, and custom application functionality.
Standard Headers for Authentication:
Common Header Examples:
Best Practice Guidelines:
- • Include only headers that your applications actually use
- • Standard headers (Authorization, Content-Type) are typically required
- • Be cautious with custom headers - only add what's necessary
- • Review headers periodically and remove unused ones
Exposed Headers
Exposed Headers determine which response headers from IdentitySuite can be accessed by client-side JavaScript. By default, browsers only expose standard headers to cross-origin requests, requiring explicit configuration for custom headers.
Headers Commonly Exposed:
Default Exposed Headers (Always Available):
Implementation Notes:
- • Only expose headers that client applications need to read
- • Custom application headers typically require explicit exposure
- • Security-sensitive headers should not be exposed unless necessary
- • Consider the security implications of exposing internal system headers
Allowed Methods
Allowed Methods specify which HTTP methods can be used in cross-origin requests to IdentitySuite. These methods correspond to different authentication and user management operations.
Standard Methods for Authentication Systems:
Method Usage by Operation:
Security Considerations:
- • Only enable methods that your applications actually use
- • DELETE method should be carefully considered for security implications
- • GET requests should never modify data or authentication state
- • Monitor for unusual method usage that might indicate attacks
Credentials and Preflight Settings
These settings control advanced CORS behavior including credential handling and preflight request optimization. Proper configuration is crucial for security and performance in authentication scenarios.
DisallowCredentials Setting:
PreflightMaxAge (600 seconds):
Recommended Settings:
- • Authentication Systems: Keep DisallowCredentials OFF to support tokens and cookies
- • Development: Use lower PreflightMaxAge (300s) for faster configuration testing
- • Production: Higher PreflightMaxAge (3600s) for better performance
- • High-Security: Consider enabling DisallowCredentials only if using purely stateless authentication