-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43dbc89
commit 8eb66c3
Showing
6 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<%@ page language="java" contentType="text/html; charset=UTF-8" | ||
pageEncoding="UTF-8"%> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>Insert title here</title> | ||
</head> | ||
<body> | ||
Access denied. | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" | ||
pageEncoding="ISO-8859-1"%> | ||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
|
||
|
||
<html> | ||
<head> | ||
<title>Login Page</title> | ||
|
||
|
||
</head> | ||
<body onload='document.f.j_username.focus();'> | ||
<h3>Login with Username and Password</h3> | ||
|
||
<c:if test="${param.error != null}"> | ||
|
||
<p class="error">Login failed. Check that your username and password are correct.</p> | ||
|
||
</c:if> | ||
|
||
|
||
<form name='f' action='${pageContext.request.contextPath}/j_spring_security_check' method='POST'> | ||
<table class="formtable"> | ||
<tr> | ||
<td>User:</td> | ||
<td><input type='text' name='j_username' value=''></td> | ||
</tr> | ||
<tr> | ||
<td>Password:</td> | ||
<td><input type='password' name='j_password' /></td> | ||
</tr> | ||
<tr> | ||
<td colspan='2'><input name="submit" type="submit" | ||
value="Login" /></td> | ||
</tr> | ||
</table> | ||
</form> | ||
|
||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security" | ||
xsi:schemaLocation="http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd | ||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> | ||
|
||
<security:authentication-manager> | ||
<security:authentication-provider> | ||
<security:jdbc-user-service | ||
data-source-ref="dataSource" | ||
authorities-by-username-query='select username, authority from users where binary username = ?' | ||
users-by-username-query='select username, password, enabled from users where binary username = ?' | ||
id="jdbcUserService" /> | ||
<security:password-encoder ref="passwordEncoder"></security:password-encoder> | ||
</security:authentication-provider> | ||
</security:authentication-manager> | ||
|
||
|
||
<security:http use-expressions="true"> | ||
<security:intercept-url pattern="/testcreate" | ||
access="isAuthenticated()" /> | ||
<security:intercept-url pattern="/reservebook" | ||
access="isAuthenticated()" /> | ||
<security:intercept-url pattern="/getreservations" | ||
access="isAuthenticated()" /> | ||
<security:intercept-url pattern="/" access="permitAll" /> | ||
<security:intercept-url pattern="/reservebus" | ||
access="permitAll" /> | ||
|
||
<security:intercept-url pattern="/createaccount" | ||
access="permitAll" /> | ||
<security:intercept-url pattern="/results" | ||
access="permitAll" /> | ||
<security:intercept-url pattern="/reservetrip" | ||
access="permitAll" /> | ||
<security:intercept-url pattern="/home" access="permitAll" /> | ||
<security:intercept-url pattern="/login" | ||
access="permitAll" /> | ||
<security:form-login login-page="/login" | ||
authentication-failure-url="/login?error=true" /> | ||
<security:logout logout-success-url="/loggedout" /> | ||
<security:access-denied-handler | ||
error-page="/denied" /> | ||
</security:http> | ||
|
||
<security:global-method-security | ||
secured-annotations="enabled"></security:global-method-security> | ||
|
||
<bean id="passwordEncoder" | ||
class="org.springframework.security.crypto.password.StandardPasswordEncoder"> | ||
</bean> | ||
|
||
|
||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.telly.controllers; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
public class UserController { | ||
@RequestMapping("/login") | ||
public String showLogin() { | ||
return "login"; | ||
} | ||
} |