File tree Expand file tree Collapse file tree 11 files changed +26
-55
lines changed
springboot-thymeleaf-security-demo/src/main/java/net/alanbinu/springbootsecurity Expand file tree Collapse file tree 11 files changed +26
-55
lines changed Original file line number Diff line number Diff line change 1- package net .javaguides .springbootsecurity ;
1+ package net .alanbinu .springbootsecurity ;
22
33import org .springframework .boot .SpringApplication ;
44import org .springframework .boot .autoconfigure .SpringBootApplication ;
Original file line number Diff line number Diff line change 1- package net .javaguides .springbootsecurity .config ;
1+ package net .alanbinu .springbootsecurity .config ;
22
33import org .springframework .beans .factory .annotation .Autowired ;
44import org .springframework .context .MessageSource ;
1010import org .springframework .web .servlet .config .annotation .WebMvcConfigurer ;
1111import org .thymeleaf .extras .springsecurity4 .dialect .SpringSecurityDialect ;
1212
13- /**
14- * @author Ramesh Fadatare
15- *
16- */
13+
1714@ Configuration
1815public class WebConfig implements WebMvcConfigurer
1916{
Original file line number Diff line number Diff line change 1- package net .javaguides .springbootsecurity .config ;
1+ package net .alanbinu .springbootsecurity .config ;
22
33import javax .sql .DataSource ;
44
Original file line number Diff line number Diff line change 1- package net .javaguides .springbootsecurity .entities ;
1+ package net .alanbinu .springbootsecurity .entities ;
22
33import javax .persistence .Column ;
44import javax .persistence .Entity ;
77import javax .persistence .Id ;
88import javax .persistence .Table ;
99
10- /**
11- * @author Ramesh Fadatare
12- *
13- */
10+
1411@ Entity
1512@ Table (name = "messages" )
1613public class Message {
Original file line number Diff line number Diff line change 1- package net .javaguides .springbootsecurity .entities ;
1+ package net .alanbinu .springbootsecurity .entities ;
22
33import java .util .List ;
44
1212
1313import org .hibernate .validator .constraints .NotEmpty ;
1414
15- /**
16- * @author Ramesh Fadatare
17- *
18- */
15+
1916@ Entity
2017@ Table (name ="roles" )
2118public class Role
Original file line number Diff line number Diff line change 1- package net .javaguides .springbootsecurity .entities ;
1+ package net .alanbinu .springbootsecurity .entities ;
22
33import java .util .List ;
44
1818import org .hibernate .validator .constraints .Email ;
1919import org .hibernate .validator .constraints .NotEmpty ;
2020
21- /**
22- * @author Ramesh Fadatare
23- *
24- */
2521@ Entity
2622@ Table (name ="users" )
2723public class User
Original file line number Diff line number Diff line change 1- package net .javaguides .springbootsecurity .repositories ;
1+ package net .alanbinu .springbootsecurity .repositories ;
22
33import org .springframework .data .jpa .repository .JpaRepository ;
44
5- import net .javaguides .springbootsecurity .entities .Message ;
5+ import net .alanbinu .springbootsecurity .entities .Message ;
6+
67
7- /**
8- * @author Ramesh Fadatare
9- *
10- */
118public interface MessageRepository extends JpaRepository <Message , Integer >{
129
1310}
Original file line number Diff line number Diff line change 1- package net .javaguides .springbootsecurity .repositories ;
1+ package net .alanbinu .springbootsecurity .repositories ;
22
33import java .util .Optional ;
44
55import org .springframework .data .jpa .repository .JpaRepository ;
66
7- import net .javaguides .springbootsecurity .entities .User ;
7+ import net .alanbinu .springbootsecurity .entities .User ;
88
99
10- /**
11- * @author Ramesh Fadatare
12- *
13- */
1410public interface UserRepository extends JpaRepository <User , Integer >
1511{
1612
Original file line number Diff line number Diff line change 1- package net .javaguides .springbootsecurity .security ;
1+ package net .alanbinu .springbootsecurity .security ;
22
33import java .util .Collection ;
44import java .util .HashSet ;
88import org .springframework .security .core .GrantedAuthority ;
99import org .springframework .security .core .authority .AuthorityUtils ;
1010
11- import net .javaguides .springbootsecurity .entities .Role ;
12- import net .javaguides .springbootsecurity .entities .User ;
11+ import net .alanbinu .springbootsecurity .entities .Role ;
12+ import net .alanbinu .springbootsecurity .entities .User ;
13+
1314
14- /**
15- * @author Ramesh Fadatare
16- *
17- */
1815public class AuthenticatedUser extends org .springframework .security .core .userdetails .User
1916{
2017
Original file line number Diff line number Diff line change 1- package net .javaguides .springbootsecurity .security ;
1+ package net .alanbinu .springbootsecurity .security ;
22
33import java .util .Collection ;
44
1111import org .springframework .stereotype .Service ;
1212import org .springframework .transaction .annotation .Transactional ;
1313
14- import net .javaguides .springbootsecurity .entities .User ;
15- import net .javaguides .springbootsecurity .repositories .UserRepository ;
14+ import net .alanbinu .springbootsecurity .entities .User ;
15+ import net .alanbinu .springbootsecurity .repositories .UserRepository ;
16+
1617
17- /**
18- * @author Ramesh Fadatare
19- *
20- */
2118@ Service
2219@ Transactional
2320public class CustomUserDetailsService implements UserDetailsService {
You can’t perform that action at this time.
0 commit comments