File tree Expand file tree Collapse file tree
java/com/baeldung/spring/security/x509
java/com/baeldung/spring/security/x509 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353 </plugin >
5454 </plugins >
5555 </build >
56-
57-
5856</project >
Original file line number Diff line number Diff line change 11package com .baeldung .spring .security .x509 ;
22
3- import org .springframework .beans .factory .annotation .Autowired ;
43import org .springframework .boot .SpringApplication ;
54import org .springframework .boot .autoconfigure .SpringBootApplication ;
65import org .springframework .context .annotation .Bean ;
7- import org .springframework .security .authentication .AuthenticationManager ;
8- import org .springframework .security .config .annotation .authentication .builders .AuthenticationManagerBuilder ;
96import org .springframework .security .config .annotation .method .configuration .EnableGlobalMethodSecurity ;
107import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
11- import org .springframework .security .config .annotation .web .builders .WebSecurity ;
128import org .springframework .security .config .annotation .web .configuration .EnableWebSecurity ;
139import org .springframework .security .config .annotation .web .configuration .WebSecurityConfigurerAdapter ;
1410import org .springframework .security .core .authority .AuthorityUtils ;
2117@ EnableWebSecurity
2218@ EnableGlobalMethodSecurity (prePostEnabled = true )
2319public class X509AuthenticationServer extends WebSecurityConfigurerAdapter {
24-
2520 public static void main (String [] args ) {
2621 SpringApplication .run (X509AuthenticationServer .class , args );
2722 }
Original file line number Diff line number Diff line change @@ -5,7 +5,4 @@ server.ssl.key-password=${PASSWORD}
55server.ssl.enabled =true
66server.port =8443
77security.user.name =Admin
8- security.user.password =admin
9- server.ssl.trust-store =../keystore/truststore.jks
10- server.ssl.trust-store-password =${PASSWORD}
11- server.ssl.client-auth =need
8+ security.user.password =admin
Original file line number Diff line number Diff line change 11<!DOCTYPE html>
22< html xmlns:th ="http://www.thymeleaf.org ">
3- < head >
4- < title > X.509 Authentication Demo</ title >
5- </ head >
6- < body >
7- < h2 > Hello < span th:text ="${username} " /> !</ h2 >
8- </ body >
9- </ html >
3+ < head >
4+ < title > X.509 Authentication Demo</ title >
5+ </ head >
6+ < body >
7+ < h2 > Hello < span th:text ="${username} " /> !</ h2 >
8+ </ body >
9+ </ html >
Original file line number Diff line number Diff line change 5353 </plugin >
5454 </plugins >
5555 </build >
56-
57-
5856</project >
Original file line number Diff line number Diff line change 11package com .baeldung .spring .security .x509 ;
22
3- import org .springframework .beans .factory .annotation .Autowired ;
43import org .springframework .boot .SpringApplication ;
54import org .springframework .boot .autoconfigure .SpringBootApplication ;
65import org .springframework .context .annotation .Bean ;
7- import org .springframework .security .authentication .AuthenticationManager ;
8- import org .springframework .security .config .annotation .authentication .builders .AuthenticationManagerBuilder ;
96import org .springframework .security .config .annotation .method .configuration .EnableGlobalMethodSecurity ;
107import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
11- import org .springframework .security .config .annotation .web .builders .WebSecurity ;
128import org .springframework .security .config .annotation .web .configuration .EnableWebSecurity ;
139import org .springframework .security .config .annotation .web .configuration .WebSecurityConfigurerAdapter ;
1410import org .springframework .security .core .authority .AuthorityUtils ;
Original file line number Diff line number Diff line change 11<!DOCTYPE html>
22< html xmlns:th ="http://www.thymeleaf.org ">
3- < head >
4- < title > X.509 Authentication Demo</ title >
5- </ head >
6- < body >
7- < h2 > Hello < span th:text ="${username} "/> !</ h2 >
8- </ body >
9- </ html >
3+ < head >
4+ < title > X.509 Authentication Demo</ title >
5+ </ head >
6+ < body >
7+ < h2 > Hello < span th:text ="${username} "/> !</ h2 >
8+ </ body >
9+ </ html >
You can’t perform that action at this time.
0 commit comments