Skip to content

🔑 Using security module with MySQL Database and Java web application

Notifications You must be signed in to change notification settings

hakdogan/SpringSecurity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Spring Security

This application illustrates and demonstrates use of the Spring Framework's security module with MySQL Database and Java web application(JSF2.2)

Exemplified topics

  • Authentication
  • Authorization
  • Intercept-url
  • RememberMe functionality

SQL Schema


CREATE DATABASE `springsecurity`;

USE `springsecurity`;

CREATE TABLE `users` (
  `username` char(20) COLLATE utf8_turkish_ci NOT NULL,
  `password` char(50) COLLATE utf8_turkish_ci NOT NULL,
  `enabled` tinyint(1) unsigned NOT NULL,
  `firstname` char(50) COLLATE utf8_turkish_ci NOT NULL,
  `lastname` char(50) COLLATE utf8_turkish_ci NOT NULL,
  PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci;

CREATE TABLE `user_roles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user` varchar(20) COLLATE utf8_turkish_ci NOT NULL,
  `role` varchar(20) COLLATE utf8_turkish_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `yetki_Kullanici` (`user`),
  CONSTRAINT `yetki_Kullanici` FOREIGN KEY (`user`) REFERENCES `users` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci;

CREATE TABLE `persistent_logins` (
  `username` varchar(64) COLLATE utf8_turkish_ci NOT NULL,
  `series` varchar(64) COLLATE utf8_turkish_ci NOT NULL,
  `token` varchar(64) COLLATE utf8_turkish_ci NOT NULL,
  `last_used` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`series`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_turkish_ci;

A screenshot of the application

screenshot

About

🔑 Using security module with MySQL Database and Java web application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages