Index: modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/controller/SwaggerController.java
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/controller/SwaggerController.java	(revision 57530)
+++ modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/controller/SwaggerController.java	(nonexistent)
@@ -1,15 +0,0 @@
-package eu.dnetlib.organizations.controller;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-@Controller
-public class SwaggerController {
-
-	@RequestMapping(value = { "/apidoc", "/api-doc", "/doc", "/swagger" }, method = RequestMethod.GET)
-	public String apiDoc() {
-		return "redirect:swagger-ui.html";
-	}
-
-}
Index: modules/dnet-orgs-database-application/trunk/src/main/resources/static/messages/logout.html
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/resources/static/messages/logout.html	(revision 57530)
+++ modules/dnet-orgs-database-application/trunk/src/main/resources/static/messages/logout.html	(nonexistent)
@@ -1,61 +0,0 @@
-
-
-
-<!doctype html>
-<html lang="en">
-
-<head>
-<!-- Required meta tags -->
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-
-<!-- Bootstrap CSS -->
-<link rel="stylesheet" href="../resources/css/bootstrap.min.css" />
-
-<title>Organizations Database: Logout</title>
-
-</head>
-
-<body>
-	<div ng-app="logoutApp" ng-controller="logoutCtrl" class="container">
-		
-		<div class="card text-center" style="margin-top: 25px">
-			<div class="card-header">Organizations Database</div>
-			<div class="card-body">
-				<h5 class="card-title">You have been logged out !!!</h5>
-				<p class="card-text">You will be redicted to the homepage between {{seconds}} second(s)</p>
-				<button class="btn btn-sm btn-primary" ng-click="homepage()">return to homepage</button>
-			</div>
-		</div>
-	</div>
-
-	<script src="../resources/js/jquery-3.4.1.min.js"></script>
-	<script src="../resources/js/popper.min.js"></script>
-	<script src="../resources/js/bootstrap.min.js"></script>
-	<script src="../resources/js/angular.min.js"></script>
-	
-	<script>
-		angular
-			.module('logoutApp', [])
-			.controller('logoutCtrl', function($scope, $http, $timeout) {
-
-				$scope.seconds   = 5;
-				
-				$scope.homepage  = function() { location.href = '/'; }
-				$scope.onTimeout = function() {
-					$scope.seconds--;
-					if ($scope.seconds > 0) {
-						$timeout($scope.onTimeout, 1000);
-					} else {
-						$scope.homepage();
-					}
-				};
-				
-				$timeout($scope.onTimeout, 1000);
-				
-			});
-		</script>
-	
-</body>
-
-</html>
\ No newline at end of file
Index: modules/dnet-orgs-database-application/trunk/src/main/resources/templates/home.html
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/resources/templates/home.html	(revision 57530)
+++ modules/dnet-orgs-database-application/trunk/src/main/resources/templates/home.html	(nonexistent)
@@ -1,86 +0,0 @@
-<!doctype html>
-<html lang="en">
-
-<head>
-<!-- Required meta tags -->
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
-<meta http-equiv="Pragma" content="no-cache">
-<meta http-equiv="Expires" content="0">
-
-<!-- Bootstrap CSS -->
-<link rel="stylesheet" href="resources/css/bootstrap.min.css" />
-<!-- Icons CSS -->
-<link rel="stylesheet" href="resources/css/fontawesome-all.min.css">
-
-<style type="text/css">
-.table > tbody > tr > td {
-     vertical-align: middle;
-}
-.card > .table {
-	margin-bottom: 0 !important;
-}
-
-fieldset > legend {
-	font-size: 1.2rem !important;  
-}
-
-</style>
-
-
-<title>Organizations Database</title>
-
-</head>
-
-<body ng-app="orgs">
-	<nav class="navbar navbar-expand-lg navbar-dark bg-primary" ng-controller="userCtrl">
-		<a class="navbar-brand" href="#"> <img
-			src="resources/images/openaire_logo_small.png" width="30" height="30" alt="">
-			OpenOrgs Database
-		</a>
-		<button class="navbar-toggler" type="button" data-toggle="collapse"
-			data-target="#navbarSupportedContent">
-			<span class="navbar-toggler-icon"></span>
-		</button>
-
-		<div class="collapse navbar-collapse w-100 order-1" id="navbarSupportedContent">
-			<ul class="navbar-nav mr-auto">
-				<li class="nav-item active"><a class="nav-link" href="#">Search</a></li>
-				<li class="nav-item dropdown"><a
-					class="nav-link dropdown-toggle" href="javascript:void(0)" id="navbarDropdown"
-					role="button" data-toggle="dropdown">Browse</a>
-					<div class="dropdown-menu">
-						<a class="dropdown-item" href="#!/countries">by country</a> <a
-							class="dropdown-item" href="#!/types">by type</a>
-					</div></li>
-				<li class="nav-item"><a class="nav-link" href="#!/new">New</a></li>
-				
-			</ul>
-		</div>
-		
-		<div class="navbar-collapse collapse w-100 order-2">
-			<ul class="navbar-nav ml-auto">
-				<li class="nav-item dropdown">
-					<a class="nav-link dropdown-toggle" href="javascript:void(0)" data-toggle="dropdown">{{user}}</a>
-					<div class="dropdown-menu">
-						<a class="dropdown-item" href="javascript:void(0)" ng-click="logout()">Logout</a>
-					</div>
-				</li>
-				<li class="nav-item"><a class="btn btn-outline-secondary" href="doc">API</a></li>
-			</ul>
-		</div>
-		
-	</nav>
-
-	<div class="container-fluid small mt-4" ng-view></div>
-
-	<script src="resources/js/jquery-3.4.1.min.js"></script>
-	<script src="resources/js/popper.min.js"></script>
-	<script src="resources/js/bootstrap.min.js"></script>
-	<script src="resources/js/angular.min.js"></script>
-	<script src="resources/js/angular-route.min.js"></script>
-	<script src="resources/js/organizations.js"></script>
-</body>
-
-</html>
\ No newline at end of file
Index: modules/dnet-orgs-database-application/trunk/src/main/resources/templates/redirect.html
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/resources/templates/redirect.html	(revision 57530)
+++ modules/dnet-orgs-database-application/trunk/src/main/resources/templates/redirect.html	(nonexistent)
@@ -1,6 +0,0 @@
-<html>
-<head>
-	<title>Organizations Database</title>
-	<meta http-equiv="refresh" content="0">
-<head>
-</html>
Index: modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/controller/HomeController.java
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/controller/HomeController.java	(revision 57530)
+++ modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/controller/HomeController.java	(revision 57531)
@@ -1,16 +1,7 @@
 package eu.dnetlib.organizations.controller;
 
-import java.io.IOException;
-import java.security.Principal;
-import java.util.UUID;
-
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.io.IOUtils;
-import org.springframework.http.HttpStatus;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.CookieValue;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
@@ -17,34 +8,24 @@
 @Controller
 public class HomeController {
 
-	private static final String TEMPORARY_AUTH_CODE = "TEMP_COOKIE";
+	@GetMapping("/")
+	public String home() {
+		return "/user";
+	}
 
-	@RequestMapping(value = "/", method = RequestMethod.GET)
-	public void logout(@CookieValue(name = "auth_code", required = false) final String authCode, final HttpServletResponse res, final Principal principal)
-			throws IOException {
-		res.setContentType("text/html");
+	@GetMapping("/login")
+	public String login() {
+		return "/login";
+	}
 
-		if (authCode == null) {
-			res.addCookie(new Cookie("auth_code", TEMPORARY_AUTH_CODE));
-			IOUtils.copy(getClass().getResourceAsStream("/templates/redirect.html"), res.getOutputStream());
-		} else if (authCode.equals(TEMPORARY_AUTH_CODE) || principal == null) {
-			res.setStatus(HttpStatus.UNAUTHORIZED.value());
-			res.setHeader("WWW-Authenticate", "Basic realm=\"Realm\"");
-			res.setHeader("X-Content-Type-Options", "nosniff");
-			res.setHeader("X-XSS-Protection", "1; mode=block");
-			res.setHeader("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate");
-			res.setHeader("Pragma", "no-cache");
-			res.setHeader("Expires", "0");
-			res.setHeader("X-Frame-Options", "DENY");
+	@GetMapping("/403")
+	public String error403() {
+		return "/403";
+	}
 
-			final Cookie cookie = new Cookie("auth_code", UUID.randomUUID().toString());
-			cookie.setMaxAge(-1);
+	@RequestMapping(value = { "/doc", "/swagger" }, method = RequestMethod.GET)
+	public String apiDoc() {
+		return "redirect:swagger-ui.html";
+	}
 
-			res.addCookie(cookie);
-			IOUtils.copy(getClass().getResourceAsStream("/templates/redirect.html"), res.getOutputStream());
-		} else {
-			IOUtils.copy(getClass().getResourceAsStream("/templates/home.html"), res.getOutputStream());
-		}
-
-	}
 }
Index: modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/WebSecurityConfig.java
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/WebSecurityConfig.java	(revision 57530)
+++ modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/WebSecurityConfig.java	(revision 57531)
@@ -11,6 +11,7 @@
 import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
 import org.springframework.security.crypto.factory.PasswordEncoderFactories;
 import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.security.web.access.AccessDeniedHandler;
 
 @Configuration
 @EnableWebSecurity
@@ -19,30 +20,31 @@
 	@Autowired
 	private DataSource dataSource;
 
+	@Autowired
+	private AccessDeniedHandler accessDeniedHandler;
+
 	@Override
 	protected void configure(final HttpSecurity http) throws Exception {
 
-		http.authorizeRequests()
-				.antMatchers("/", "/swagger-ui.html", "/resources/**", "/messages/**").permitAll()
-				.antMatchers("/api/**").fullyAuthenticated()
+		http.csrf().disable()
+				.authorizeRequests()
+				.antMatchers("/", "/api/**").hasAnyRole("USER", "SUPERUSER")
+				.antMatchers("/swagger-ui.html", "/doc", "/resources/**", "/webjars/**").permitAll()
+				.anyRequest().authenticated()
 				.and()
-				.httpBasic()
+				.formLogin()
+				.loginPage("/login")
+				.permitAll()
 				.and()
 				.logout()
-				.logoutSuccessUrl("/messages/logout.html").permitAll()
-				.deleteCookies("auth_code", "JSESSIONID")
-				.clearAuthentication(true)
-				.invalidateHttpSession(true)
+				.permitAll()
 				.and()
-				.csrf().disable();
-
+				.exceptionHandling().accessDeniedHandler(accessDeniedHandler);
 	}
 
 	@Autowired
 	public void configureGlobal(final AuthenticationManagerBuilder auth) throws Exception {
-
-		auth.jdbcAuthentication()
-				.dataSource(dataSource)
+		auth.jdbcAuthentication().dataSource(dataSource)
 				.usersByUsernameQuery("select email, password, valid from users where email=? and valid=true")
 				.authoritiesByUsernameQuery("select email, 'ROLE_'||role from users where email=? and valid=true");
 	}
Index: modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/MyAccessDeniedHandler.java
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/MyAccessDeniedHandler.java	(nonexistent)
+++ modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/MyAccessDeniedHandler.java	(revision 57531)
@@ -0,0 +1,35 @@
+package eu.dnetlib.organizations;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.security.access.AccessDeniedException;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.web.access.AccessDeniedHandler;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyAccessDeniedHandler implements AccessDeniedHandler {
+
+	private static Logger logger = LoggerFactory.getLogger(MyAccessDeniedHandler.class);
+
+	@Override
+	public void handle(final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse, final AccessDeniedException e)
+			throws IOException, ServletException {
+
+		final Authentication auth = SecurityContextHolder.getContext().getAuthentication();
+
+		if (auth != null) {
+			logger.warn(String.format("User '%s' attempted to access the protected URL: %s", auth.getName(), httpServletRequest.getRequestURI()));
+		}
+
+		httpServletResponse.sendRedirect(httpServletRequest.getContextPath() + "/403");
+	}
+
+}
Index: modules/dnet-orgs-database-application/trunk/src/main/resources/sql/importNewRels.sql
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/resources/sql/importNewRels.sql	(revision 57530)
+++ modules/dnet-orgs-database-application/trunk/src/main/resources/sql/importNewRels.sql	(revision 57531)
@@ -10,6 +10,8 @@
 
 COPY tmp_simrels(local_id, oa_original_id, oa_name, oa_acronym, oa_country, oa_url, oa_collectedfrom) FROM '/Users/michele/Develop/dnet45/dnet-orgs-database-application/src/main/resources/tmp_data/rels.part-r-00000.tsv' DELIMITER E'\t';;
 
+DELETE FROM openaire_simrels WHERE reltype = 'suggested';
+
 INSERT INTO openaire_simrels (local_id, oa_original_id, oa_name, oa_acronym, oa_country, oa_url, oa_collectedfrom)
 SELECT local_id, oa_original_id, oa_name, oa_acronym, oa_country, oa_url, oa_collectedfrom
 FROM tmp_simrels
Index: modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/list.html
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/list.html	(revision 57530)
+++ modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/list.html	(revision 57531)
@@ -1,5 +1,5 @@
-<p ng-if="orgs.number">Page: {{orgs.number + 1}} / {{orgs.totalPages}}<br />Total elements: {{orgs.totalElements}}<br />Searching for: {{fieldValue}}</p>
-<p ng-if="!orgs.number">Page:<br />Total elements:<br />Searching for: {{fieldValue}}</p>
+<p ng-if="orgs.number || orgs.number === 0">Page: {{orgs.number + 1}} / {{orgs.totalPages}}<br />Total elements: {{orgs.totalElements}}<br />Searching for: {{fieldValue}}</p>
+<p ng-if="!(orgs.number || orgs.number === 0)">Page:<br />Total elements:<br />Searching for: {{fieldValue}}</p>
 
 <nav>
 	<ul class="pagination justify-content-center">
Index: modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/js/organizations.js
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/js/organizations.js	(revision 57530)
+++ modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/js/organizations.js	(revision 57531)
@@ -34,10 +34,6 @@
 	}, function errorCallback(res) {
 		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
 	});
-	
-	$scope.logout = function() {
-		location.href= "/logout";
-	}
 });
 
 orgsModule.controller('newOrgCtrl', function ($scope, $http, $routeParams, $location) {
Index: modules/dnet-orgs-database-application/trunk/src/main/resources/templates/user.html
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/resources/templates/user.html	(nonexistent)
+++ modules/dnet-orgs-database-application/trunk/src/main/resources/templates/user.html	(revision 57531)
@@ -0,0 +1,86 @@
+<!doctype html>
+<html lang="en">
+
+<head>
+<!-- Required meta tags -->
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
+<meta http-equiv="Pragma" content="no-cache">
+<meta http-equiv="Expires" content="0">
+
+<!-- Bootstrap CSS -->
+<link rel="stylesheet" href="resources/css/bootstrap.min.css" />
+<!-- Icons CSS -->
+<link rel="stylesheet" href="resources/css/fontawesome-all.min.css">
+
+<style type="text/css">
+.table > tbody > tr > td {
+     vertical-align: middle;
+}
+.card > .table {
+	margin-bottom: 0 !important;
+}
+
+fieldset > legend {
+	font-size: 1.2rem !important;  
+}
+
+</style>
+
+
+<title>Organizations Database</title>
+
+</head>
+
+<body ng-app="orgs">
+	<nav class="navbar navbar-expand-lg navbar-dark bg-primary" ng-controller="userCtrl">
+		<a class="navbar-brand" href="#"> <img
+			src="resources/images/openaire_logo_small.png" width="30" height="30" alt="OpenOrgs Database">
+			OpenOrgs Database
+		</a>
+		<button class="navbar-toggler" type="button" data-toggle="collapse"
+			data-target="#navbarSupportedContent">
+			<span class="navbar-toggler-icon"></span>
+		</button>
+
+		<div class="collapse navbar-collapse w-100 order-1" id="navbarSupportedContent">
+			<ul class="navbar-nav mr-auto">
+				<li class="nav-item active"><a class="nav-link" href="#">Search</a></li>
+				<li class="nav-item dropdown"><a
+					class="nav-link dropdown-toggle" href="javascript:void(0)" id="navbarDropdown"
+					role="button" data-toggle="dropdown">Browse</a>
+					<div class="dropdown-menu">
+						<a class="dropdown-item" href="#!/countries">by country</a> <a
+							class="dropdown-item" href="#!/types">by type</a>
+					</div></li>
+				<li class="nav-item"><a class="nav-link" href="#!/new">New</a></li>
+				
+			</ul>
+		</div>
+		
+		<div class="navbar-collapse collapse w-100 order-2">
+			<ul class="navbar-nav ml-auto">
+				<li class="nav-item dropdown">
+					<a class="nav-link dropdown-toggle" href="javascript:void(0)" data-toggle="dropdown">{{user}}</a>
+					<div class="dropdown-menu">
+						<a class="dropdown-item" th:href="@{/logout}">Logout</a>
+					</div>
+				</li>
+				<li class="nav-item"><a class="btn btn-outline-secondary" href="doc">API</a></li>
+			</ul>
+		</div>
+		
+	</nav>
+
+	<div class="container-fluid small mt-4" ng-view></div>
+
+	<script src="resources/js/jquery-3.4.1.min.js"></script>
+	<script src="resources/js/popper.min.js"></script>
+	<script src="resources/js/bootstrap.min.js"></script>
+	<script src="resources/js/angular.min.js"></script>
+	<script src="resources/js/angular-route.min.js"></script>
+	<script src="resources/js/organizations.js"></script>
+</body>
+
+</html>
\ No newline at end of file
Index: modules/dnet-orgs-database-application/trunk/src/main/resources/templates/403.html
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/resources/templates/403.html	(nonexistent)
+++ modules/dnet-orgs-database-application/trunk/src/main/resources/templates/403.html	(revision 57531)
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML>
+<html xmlns:th="http://www.thymeleaf.org">
+
+<head>
+	<meta charset="utf-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
+	<meta http-equiv="Pragma" content="no-cache">
+	<meta http-equiv="Expires" content="0">
+
+	<!-- Bootstrap CSS -->
+	<link rel="stylesheet" href="resources/css/bootstrap.min.css" />
+	
+	<title>Organizations Database: not authorized</title>
+</head>
+
+<body>
+
+	<div class="container">
+		<nav class="navbar navbar-expand-lg navbar-dark bg-primary" ng-controller="userCtrl">
+			<a class="navbar-brand" href="#"> 
+				<img src="resources/images/openaire_logo_small.png" width="30" height="30" alt="OpenOrgs Database"> OpenOrgs Database
+			</a>
+		</nav>
+	    
+	    
+	    <div class="card text-center" style="margin-top: 25px">
+			<div class="card-body">
+				<h5 class="card-title">403 - Access is denied</h5>
+				<p class="card-text" th:inline="text">Hello '[[${#httpServletRequest.remoteUser}]]', you do not have permission to access this page.</p>
+			</div>
+		</div>
+    
+	
+	</div>
+
+	<script src="resources/js/bootstrap.min.js"></script>
+
+</body>
+
+</html>
\ No newline at end of file
Index: modules/dnet-orgs-database-application/trunk/src/main/resources/templates/login.html
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/resources/templates/login.html	(nonexistent)
+++ modules/dnet-orgs-database-application/trunk/src/main/resources/templates/login.html	(revision 57531)
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
+
+<head>
+	<meta charset="utf-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
+	<meta http-equiv="Pragma" content="no-cache">
+	<meta http-equiv="Expires" content="0">
+
+	<!-- Bootstrap CSS -->
+	<link rel="stylesheet" href="resources/css/bootstrap.min.css" />
+	
+	<title>Organizations Database: Login</title>
+</head>
+
+<body>
+
+	<div>
+	    <nav class="navbar navbar-expand-lg navbar-dark bg-primary" ng-controller="userCtrl">
+			<a class="navbar-brand" href="#"> 
+				<img src="resources/images/openaire_logo_small.png" width="30" height="30" alt="OpenOrgs Database"> OpenOrgs Database
+			</a>
+		</nav>
+	</div>
+
+	<div class="container">
+	
+	    <div class="row" style="margin-top:20px">
+	        <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-3">
+	            <form th:action="@{/login}" method="post">
+	                <fieldset>
+	                    <h1>Please Sign In</h1>
+	
+	                    <div th:if="${param.error}">
+	                        <div class="alert alert-danger">
+	                            Invalid username and password.
+	                        </div>
+	                    </div>
+	                    <div th:if="${param.logout}">
+	                        <div class="alert alert-info">
+	                            You have been logged out.
+	                        </div>
+	                    </div>
+	
+	                    <div class="form-group">
+	                        <input type="text" name="username" id="username" class="form-control input-lg"
+	                               placeholder="UserName" required="true" autofocus="true"/>
+	                    </div>
+	                    <div class="form-group">
+	                        <input type="password" name="password" id="password" class="form-control input-lg"
+	                               placeholder="Password" required="true"/>
+	                    </div>
+	
+	                    <div class="row">
+	                        <div class="col-xs-6 col-sm-6 col-md-6">
+	                            <input type="submit" class="btn btn-lg btn-primary btn-block" value="Sign In"/>
+	                        </div>
+	                        <div class="col-xs-6 col-sm-6 col-md-6">
+	                        </div>
+	                    </div>
+	                </fieldset>
+	            </form>
+	        </div>
+	    </div>
+	
+	</div>
+
+	<script src="resources/js/bootstrap.min.js"></script>
+
+</body>
+</html>
\ No newline at end of file
Index: modules/dnet-orgs-database-application/trunk/pom.xml
===================================================================
--- modules/dnet-orgs-database-application/trunk/pom.xml	(revision 57530)
+++ modules/dnet-orgs-database-application/trunk/pom.xml	(revision 57531)
@@ -66,6 +66,10 @@
 			<artifactId>spring-boot-starter-web</artifactId>
 		</dependency>
 		<dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-data-jpa</artifactId>
 		</dependency>
@@ -78,6 +82,10 @@
 			<artifactId>spring-boot-starter-security</artifactId>
 		</dependency>
 		<dependency>
+            <groupId>org.thymeleaf.extras</groupId>
+            <artifactId>thymeleaf-extras-springsecurity4</artifactId>
+        </dependency>
+		<dependency>
 			<groupId>org.postgresql</groupId>
 			<artifactId>postgresql</artifactId>
 		</dependency>
@@ -86,6 +94,12 @@
 			<artifactId>hibernate-types-52</artifactId>
 			<version>2.3.5</version>
 		</dependency>
+		 <!-- hot swapping, disable cache for template, enable live reload -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional>
+        </dependency>
 
 		<!-- Utils -->
 		<dependency>
