Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
e34bdcdd
Commit
e34bdcdd
authored
Jun 26, 2015
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2713 from rob-baily/master
* pr/2713: Fix logout in sample secure web applications
parents
a36d1e2e
3c503869
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
6 deletions
+13
-6
SampleWebSecureCustomApplication.java
...e/web/secure/custom/SampleWebSecureCustomApplication.java
+1
-1
home.html
...-web-secure-custom/src/main/resources/templates/home.html
+3
-1
SampleWebSecureCustomApplication.java
...ple/web/secure/jdbc/SampleWebSecureCustomApplication.java
+1
-1
home.html
...le-web-secure-jdbc/src/main/resources/templates/home.html
+3
-1
SampleWebSecureApplication.java
...in/java/sample/web/secure/SampleWebSecureApplication.java
+2
-1
home.html
...-sample-web-secure/src/main/resources/templates/home.html
+3
-1
No files found.
spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/java/sample/web/secure/custom/SampleWebSecureCustomApplication.java
View file @
e34bdcdd
...
@@ -76,7 +76,7 @@ public class SampleWebSecureCustomApplication extends WebMvcConfigurerAdapter {
...
@@ -76,7 +76,7 @@ public class SampleWebSecureCustomApplication extends WebMvcConfigurerAdapter {
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
http
.
authorizeRequests
().
antMatchers
(
"/css/**"
).
permitAll
().
anyRequest
()
http
.
authorizeRequests
().
antMatchers
(
"/css/**"
).
permitAll
().
anyRequest
()
.
fullyAuthenticated
().
and
().
formLogin
().
loginPage
(
"/login"
)
.
fullyAuthenticated
().
and
().
formLogin
().
loginPage
(
"/login"
)
.
failureUrl
(
"/login?error"
).
permitAll
();
.
failureUrl
(
"/login?error"
).
permitAll
()
.
and
().
logout
().
permitAll
()
;
}
}
@Override
@Override
...
...
spring-boot-samples/spring-boot-sample-web-secure-custom/src/main/resources/templates/home.html
View file @
e34bdcdd
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
Plain
</a>
Plain
</a>
<ul
class=
"nav"
>
<ul
class=
"nav"
>
<li><a
th:href=
"@{/}"
href=
"home.html"
>
Home
</a></li>
<li><a
th:href=
"@{/}"
href=
"home.html"
>
Home
</a></li>
<li><a
th:href=
"@{/logout}"
href=
"logout"
>
Logout
</a></li>
</ul>
</ul>
</div>
</div>
</div>
</div>
...
@@ -21,6 +20,9 @@
...
@@ -21,6 +20,9 @@
<div
th:text=
"${message}"
>
Fake content
</div>
<div
th:text=
"${message}"
>
Fake content
</div>
<div
id=
"created"
th:text=
"${#dates.format(date)}"
>
July 11,
<div
id=
"created"
th:text=
"${#dates.format(date)}"
>
July 11,
2012 2:17:16 PM CDT
</div>
2012 2:17:16 PM CDT
</div>
<form
th:action=
"@{/logout}"
method=
"post"
>
<input
type=
"submit"
value=
"Sign Out"
/>
</form>
</div>
</div>
</body>
</body>
</html>
</html>
spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/java/sample/web/secure/jdbc/SampleWebSecureCustomApplication.java
View file @
e34bdcdd
...
@@ -81,7 +81,7 @@ public class SampleWebSecureCustomApplication extends WebMvcConfigurerAdapter {
...
@@ -81,7 +81,7 @@ public class SampleWebSecureCustomApplication extends WebMvcConfigurerAdapter {
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
http
.
authorizeRequests
().
antMatchers
(
"/css/**"
).
permitAll
().
anyRequest
()
http
.
authorizeRequests
().
antMatchers
(
"/css/**"
).
permitAll
().
anyRequest
()
.
fullyAuthenticated
().
and
().
formLogin
().
loginPage
(
"/login"
)
.
fullyAuthenticated
().
and
().
formLogin
().
loginPage
(
"/login"
)
.
failureUrl
(
"/login?error"
).
permitAll
();
.
failureUrl
(
"/login?error"
).
permitAll
()
.
and
().
logout
().
permitAll
()
;
}
}
@Override
@Override
...
...
spring-boot-samples/spring-boot-sample-web-secure-jdbc/src/main/resources/templates/home.html
View file @
e34bdcdd
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
Plain
</a>
Plain
</a>
<ul
class=
"nav"
>
<ul
class=
"nav"
>
<li><a
th:href=
"@{/}"
href=
"home.html"
>
Home
</a></li>
<li><a
th:href=
"@{/}"
href=
"home.html"
>
Home
</a></li>
<li><a
th:href=
"@{/logout}"
href=
"logout"
>
Logout
</a></li>
</ul>
</ul>
</div>
</div>
</div>
</div>
...
@@ -21,6 +20,9 @@
...
@@ -21,6 +20,9 @@
<div
th:text=
"${message}"
>
Fake content
</div>
<div
th:text=
"${message}"
>
Fake content
</div>
<div
id=
"created"
th:text=
"${#dates.format(date)}"
>
July 11,
<div
id=
"created"
th:text=
"${#dates.format(date)}"
>
July 11,
2012 2:17:16 PM CDT
</div>
2012 2:17:16 PM CDT
</div>
<form
th:action=
"@{/logout}"
method=
"post"
>
<input
type=
"submit"
value=
"Sign Out"
/>
</form>
</div>
</div>
</body>
</body>
</html>
</html>
spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/web/secure/SampleWebSecureApplication.java
View file @
e34bdcdd
...
@@ -71,7 +71,8 @@ public class SampleWebSecureApplication extends WebMvcConfigurerAdapter {
...
@@ -71,7 +71,8 @@ public class SampleWebSecureApplication extends WebMvcConfigurerAdapter {
@Override
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
http
.
authorizeRequests
().
anyRequest
().
fullyAuthenticated
().
and
().
formLogin
()
http
.
authorizeRequests
().
anyRequest
().
fullyAuthenticated
().
and
().
formLogin
()
.
loginPage
(
"/login"
).
failureUrl
(
"/login?error"
).
permitAll
();
.
loginPage
(
"/login"
).
failureUrl
(
"/login?error"
).
permitAll
().
and
()
.
logout
().
permitAll
();
}
}
@Override
@Override
...
...
spring-boot-samples/spring-boot-sample-web-secure/src/main/resources/templates/home.html
View file @
e34bdcdd
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
Plain
</a>
Plain
</a>
<ul
class=
"nav"
>
<ul
class=
"nav"
>
<li><a
th:href=
"@{/}"
href=
"home.html"
>
Home
</a></li>
<li><a
th:href=
"@{/}"
href=
"home.html"
>
Home
</a></li>
<li><a
th:href=
"@{/logout}"
href=
"logout"
>
Logout
</a></li>
</ul>
</ul>
</div>
</div>
</div>
</div>
...
@@ -21,6 +20,9 @@
...
@@ -21,6 +20,9 @@
<div
th:text=
"${message}"
>
Fake content
</div>
<div
th:text=
"${message}"
>
Fake content
</div>
<div
id=
"created"
th:text=
"${#dates.format(date)}"
>
July 11,
<div
id=
"created"
th:text=
"${#dates.format(date)}"
>
July 11,
2012 2:17:16 PM CDT
</div>
2012 2:17:16 PM CDT
</div>
<form
th:action=
"@{/logout}"
method=
"post"
>
<input
type=
"submit"
value=
"Sign Out"
/>
</form>
</div>
</div>
</body>
</body>
</html>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment