add https support for platform available at localhost:8443 by default when running from command line.

This commit is contained in:
Keith Woodlock
2012-05-21 17:36:51 +01:00
parent 69722c9409
commit 4a8d5a86f6
14 changed files with 138 additions and 212 deletions
@@ -7,14 +7,13 @@
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<http security="none" pattern="/api/*/authentication" />
<http create-session="stateless" use-expressions="true" pattern="/api/**">
<intercept-url pattern="/api/**" access="isFullyAuthenticated()" method="GET"/>
<intercept-url pattern="/api/**" access="isFullyAuthenticated()" method="POST"/>
<intercept-url pattern="/api/**" access="isFullyAuthenticated()" method="PUT"/>
<intercept-url pattern="/api/**" access="isFullyAuthenticated()" method="DELETE"/>
<intercept-url pattern="/api/**" access="isFullyAuthenticated()" method="HEAD"/>
<intercept-url pattern="/api/*/authentication" access="permitAll" method="POST" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated()" method="GET" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated()" method="POST" requires-channel="https"/>
<intercept-url pattern="/api/**" access="isFullyAuthenticated()" method="PUT" requires-channel="https"/>
<intercept-url pattern="/api/**" access="isFullyAuthenticated()" method="DELETE" requires-channel="https"/>
<intercept-url pattern="/api/**" access="isFullyAuthenticated()" method="HEAD" requires-channel="https"/>
<http-basic />
</http>
@@ -1,44 +0,0 @@
<%@ page import="org.springframework.security.core.AuthenticationException" %>
<%@ page import="org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter" %>
<%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>MifosNg Platform: Access Confirmation</title>
</head>
<body>
<h1>MifosNg</h1>
<div id="content">
<c:if test="${!empty sessionScope.SPRING_SECURITY_LAST_EXCEPTION}">
<div class="error">
<h2>Woops!</h2>
<p>Access could not be granted. (<%= ((AuthenticationException) session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %>)</p>
</div>
</c:if>
<c:remove scope="session" var="SPRING_SECURITY_LAST_EXCEPTION"/>
<h2>Please Confirm</h2>
<p>You hereby authorize "<c:out value="${consumer.consumerName}"/>" to access the following resource:</p>
<ul>
<li><c:out value="${consumer.resourceName}"/> &mdash; <c:out value="${consumer.resourceDescription}"/></li>
</ul>
<form action="<c:url value="/oauth/authorize"/>" method="POST">
<input name="requestToken" value="<c:out value="${oauth_token}"/>" type="hidden"/>
<label><input name="authorize" value="Authorize" type="submit"></label>
</form>
</div>
</body>
</html>
@@ -1,19 +0,0 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>MifosNg Platform</title>
</head>
<body>
<h1>Successful Authentication</h1>
<div id="content">
<p>There are no UI capabilities on MifosNg Platform. You must use a suitable consumer (client) application to use our platform services.</p>
</div>
</body>
</html>
@@ -1,73 +0,0 @@
<%@ page session="true" %>
<%@ page import="org.springframework.security.core.AuthenticationException" %>
<%@ page import="org.springframework.security.web.WebAttributes" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<c:set var="applicationName" scope="session" value="Mifos - Individual Lending: " />
<c:set var="pageTitle" scope="session" value="Login"/>
<!DOCTYPE html>
<html lang="en">
<head>
<jsp:include page="common-head.jsp" />
<script>
$(document).ready(function() {
$('#login').button();
});
</script>
</head>
<body>
<div id="container">
<div id="content">
<div id="spacer" style="line-height: 25px;">&nbsp;</div>
</div>
</div>
</body>
</html>
<!--
<h1>Mifos - Individual Lending: Login</h1>
<div id="formcontainer">
<c:if test="${!empty sessionScope.SPRING_SECURITY_LAST_EXCEPTION}">
<div class="ui-widget">
<div class="ui-state-error ui-corner-all">
<span class="ui-icon ui-icon-alert" style="float: left; margin-right: 5px;" ></span>
<span>You have the following errors:</span>
<div style="margin-left: 5px;">
<p>Your login attempt was not successful. (<%= ((AuthenticationException) session.getAttribute(WebAttributes.AUTHENTICATION_EXCEPTION)).getMessage() %>)</p>
</div>
</div>
</div>
</c:if>
<c:remove scope="session" var="SPRING_SECURITY_LAST_EXCEPTION"/>
<c:url value="/j_spring_security_check" var="loginFilterUrl" />
<c:url value="${successUrl}" var="authSuccessUrl" />
<form method="post" action="${loginFilterUrl}">
<fieldset>
<legend>Login</legend>
<label for="username">Username:</label>
<input type="hidden" name="successUrl" value="${successUrl}" />
<c:choose>
<c:when test="${param.oauth_token == null}">
<input id="testone" type="hidden" name="oauth_token" value="${requestScope.oauth_token}" />
</c:when>
<c:otherwise>
<input id="testtwo" type="hidden" name="oauth_token" value="${param.oauth_token}" />
</c:otherwise>
</c:choose>
<input size="75" type="text" name="j_username" id="username" title="Username for authentication." />
<label for="password">Password:</label>
<input size="75" type="password" name="j_password" id="password" title="Password for authentication."/>
<div id="formbuttons">
<button type="submit" id="login" name="login" title="Log in to application.">Login</button>
</div>
</fieldset>
</form>
-->