|
@@ -629,32 +629,34 @@ List<OpenIDAttribute> attributes = token.getAttributes();</programlisting>The
|
|
|
<para>A lot of different attacks to hijack content, sessions or connections are available and lately
|
|
|
browsers (optionally) can help to prevent those attacks. To enable these features we need to send some
|
|
|
additional headers to the client. Spring Security allows for easy configuration for several headers.
|
|
|
- <programlisting language="xml">
|
|
|
- <![CDATA[
|
|
|
- <headers/>
|
|
|
- ]]>
|
|
|
+ <programlisting language="xml"><![CDATA[
|
|
|
+<http ...>
|
|
|
+ ...
|
|
|
+ <headers/>
|
|
|
+</http>]]>
|
|
|
</programlisting>
|
|
|
</para>
|
|
|
<para>Specifying the single headers element adds all the explicitly supported headers
|
|
|
with their default settings. If you only want select headers to be added,
|
|
|
you can add one or more of the child elements as shown below.
|
|
|
- <programlisting language="xml">
|
|
|
- <![CDATA[
|
|
|
- <headers>
|
|
|
- <!-- Add Cache-Control and Pragma headers -->
|
|
|
- <cache-control/>
|
|
|
- <!-- Add X-Content-Type-Options with value of nosniff -->
|
|
|
- <content-type-options/>
|
|
|
- <!-- Add custom headers -->
|
|
|
- <header name="foo" value="bar"/>
|
|
|
- <-- Adds HTTP Strict Transport Security (HSTS) for secure requests -->
|
|
|
- <hsts/>
|
|
|
- <!-- Add X-Frame-Options with a value of DENY -->
|
|
|
- <frame-options/>
|
|
|
- <!-- Adds X-XSS-Protection with value of 1; mode=block-->
|
|
|
- <xss-protection/>
|
|
|
- </headers>
|
|
|
- ]]>
|
|
|
+ <programlisting language="xml"><![CDATA[
|
|
|
+<http ...>
|
|
|
+ ...
|
|
|
+ <headers>
|
|
|
+ <!-- Add Cache-Control and Pragma headers -->
|
|
|
+ <cache-control/>
|
|
|
+ <!-- Add X-Content-Type-Options with value of nosniff -->
|
|
|
+ <content-type-options/>
|
|
|
+ <!-- Add custom headers -->
|
|
|
+ <header name="foo" value="bar"/>
|
|
|
+ <-- Adds HTTP Strict Transport Security (HSTS) for secure requests -->
|
|
|
+ <hsts/>
|
|
|
+ <!-- Add X-Frame-Options with a value of DENY -->
|
|
|
+ <frame-options/>
|
|
|
+ <!-- Adds X-XSS-Protection with value of 1; mode=block-->
|
|
|
+ <xss-protection/>
|
|
|
+ </headers>
|
|
|
+</http>]]>
|
|
|
</programlisting>
|
|
|
</para>
|
|
|
<para>For additional information on how to customize the headers element refer to the <link xlink:href="#nsa-headers">headers</link>
|