reactive/webflux/hello-security-explicit
This commit is contained in:
parent
a19d2a6aa8
commit
a54a4c5c5f
|
@ -42,7 +42,7 @@ public class SecurityConfiguration {
|
||||||
.authorizeExchange((exchanges) -> exchanges
|
.authorizeExchange((exchanges) -> exchanges
|
||||||
.anyExchange().authenticated()
|
.anyExchange().authenticated()
|
||||||
)
|
)
|
||||||
.httpBasic(withDefaults());
|
.formLogin(withDefaults());
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
return http.build();
|
return http.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Hello Security</h1>
|
<h1>Hello Security</h1>
|
||||||
<a th:href="@{/logout}">Log Out</a>
|
<a id="logout" th:href="@{/logout}">Log Out</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -40,7 +40,7 @@ public class HelloSecurityTests {
|
||||||
this.rest.get()
|
this.rest.get()
|
||||||
.uri("/")
|
.uri("/")
|
||||||
.exchange()
|
.exchange()
|
||||||
.expectStatus().isUnauthorized();
|
.expectStatus().is3xxRedirection();
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue