@@ -75,6 +75,35 @@ To learn more from the source or to make advanced customizations, see:
75
75
76
76
77
77
78
+ [[webflux-cors-credentialed-requests]]
79
+ == Credentialed Requests
80
+ [.small]#xref:web/webmvc-cors.adoc#mvc-cors-credentialed-requests[See equivalent in the Servlet stack]#
81
+
82
+ Using CORS with credentialed requests requires enabling `allowedCredentials`. Be aware that
83
+ this option establishes a high level of trust with the configured domains and also increases
84
+ the surface of attack of the web application by exposing sensitive user-specific information
85
+ such as cookies and CSRF tokens.
86
+
87
+ Enabling credentials also impacts how the configured `"*"` CORS wildcards are processed:
88
+
89
+ * Wildcards are not authorized in `allowOrigins`, but alternatively
90
+ the `allowOriginPatterns` property may be used to match to a dynamic set of origins.
91
+ * When set on `allowedHeaders` or `allowedMethods`, the `Access-Control-Allow-Headers`
92
+ and `Access-Control-Allow-Methods` response headers are handled by copying the related
93
+ headers and method specified in the CORS preflight request.
94
+ * When set on `exposedHeaders`, `Access-Control-Expose-Headers` response header is set
95
+ either to the configured list of headers or to the wildcard character. While the CORS spec
96
+ does not allow the wildcard character when `Access-Control-Allow-Credentials` is set to
97
+ `true`, most browsers support it and the response headers are not all available during the
98
+ CORS processing, so as a consequence the wildcard character is the header value used when
99
+ specified regardless of the value of the `allowCredentials` property.
100
+
101
+ WARNING: While such wildcard configuration can be handy, it is recommended when possible to configure
102
+ a finite set of values instead to provide a higher level of security.
103
+
104
+
105
+
106
+
78
107
[[webflux-cors-controller]]
79
108
== `@CrossOrigin`
80
109
[.small]#xref:web/webmvc-cors.adoc#mvc-cors-controller[See equivalent in the Servlet stack]#
0 commit comments