mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-01 09:42:13 +00:00
Add role=primary/secondary example
Issue gh-7801
This commit is contained in:
parent
b85b4b8643
commit
3fb87d10e9
@ -7,11 +7,12 @@ This section provides details on how Spring Security provides support for https:
|
|||||||
Spring Security's HTTP Basic Authentication support in is enabled by default.
|
Spring Security's HTTP Basic Authentication support in is enabled by default.
|
||||||
However, as soon as any servlet based configuration is provided, HTTP Basic must be explicitly provided.
|
However, as soon as any servlet based configuration is provided, HTTP Basic must be explicitly provided.
|
||||||
|
|
||||||
A minimal, explicit Java configuration can be found below:
|
A minimal, explicit configuration can be found below:
|
||||||
|
|
||||||
.HTTP Basic Java Configuration
|
.Explicit HTTP Basic Configuration
|
||||||
====
|
====
|
||||||
[source,java]
|
[source,java,role="primary"]
|
||||||
|
.Java
|
||||||
----
|
----
|
||||||
protected void configure(HttpSecurity http) {
|
protected void configure(HttpSecurity http) {
|
||||||
http
|
http
|
||||||
@ -19,13 +20,9 @@ protected void configure(HttpSecurity http) {
|
|||||||
.httpBasic(withDefaults());
|
.httpBasic(withDefaults());
|
||||||
}
|
}
|
||||||
----
|
----
|
||||||
====
|
|
||||||
|
|
||||||
A minimal XML configuration can be found below:
|
[source,xml,role="secondary"]
|
||||||
|
.XML
|
||||||
.HTTP Basic XML Configuration
|
|
||||||
====
|
|
||||||
[source,xml]
|
|
||||||
----
|
----
|
||||||
<http>
|
<http>
|
||||||
<!-- ... -->
|
<!-- ... -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user