Merge branch 'master' of github.com:jricher/OpenID-Connect-Java-Spring-Server
commit
0e0ef578e5
|
@ -15,4 +15,10 @@ public class ManagerController {
|
||||||
public String showHomePage() {
|
public String showHomePage() {
|
||||||
return "home";
|
return "home";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/admin/manage/clients")
|
||||||
|
public String showClientManager() {
|
||||||
|
return "admin/manage/clients";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
|
|
||||||
<!-- Le javascript -->
|
<!-- Le javascript -->
|
||||||
<script src="http://code.jquery.com/jquery-1.7.min.js"></script>
|
<script src="http://code.jquery.com/jquery-1.7.min.js"></script>
|
||||||
|
<script src="resources/js/app.js"></script>
|
||||||
|
<script src="resources/js/tmpl.js"></script>
|
||||||
|
|
||||||
<script src="resources/bootstrap/js/bootstrap-modal.js"></script>
|
<script src="resources/bootstrap/js/bootstrap-modal.js"></script>
|
||||||
<script src="resources/bootstrap/js/bootstrap-alerts.js"></script>
|
<script src="resources/bootstrap/js/bootstrap-alerts.js"></script>
|
||||||
<script src="resources/bootstrap/js/bootstrap-twipsy.js"></script>
|
<script src="resources/bootstrap/js/bootstrap-twipsy.js"></script>
|
||||||
|
@ -24,9 +27,6 @@
|
||||||
<script src="resources/bootstrap/js/bootstrap-tabs.js"></script>
|
<script src="resources/bootstrap/js/bootstrap-tabs.js"></script>
|
||||||
<script src="resources/bootstrap/js/bootstrap-buttons.js"></script>
|
<script src="resources/bootstrap/js/bootstrap-buttons.js"></script>
|
||||||
|
|
||||||
<script>$(function () {
|
|
||||||
|
|
||||||
})</script>
|
|
||||||
|
|
||||||
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<h5>Administrative</h5>
|
<h5>Administrative</h5>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#">Manage Clients</a></li>
|
<li><a href="admin/manage/clients">Manage Clients</a></li>
|
||||||
<li><a href="#">White Lists</a></li>
|
<li><a href="#">White Lists</a></li>
|
||||||
<li><a href="#">Black Lists</a></li>
|
<li><a href="#">Black Lists</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -0,0 +1,215 @@
|
||||||
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||||
|
<%@ taglib prefix="o" tagdir="/WEB-INF/tags" %>
|
||||||
|
|
||||||
|
<o:header title="welcome" />
|
||||||
|
|
||||||
|
<script type="text/html" id="client_tmpl">
|
||||||
|
<tr>
|
||||||
|
<td><#=name#></td>
|
||||||
|
<td><#=redirectURL#></td>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<# for (var i in grantType) { #>
|
||||||
|
<li><#=grantType[i]#></li>
|
||||||
|
<# } #>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ul>
|
||||||
|
<# for (var i in scope) { #>
|
||||||
|
<li><#=scope[i]#></li>
|
||||||
|
<# } #>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
<td><#=authority#></td>
|
||||||
|
<td><#=description#>
|
||||||
|
</td>
|
||||||
|
<td><input type="checkbox" "<#=(refreshTokens == 1 ? 'checked' : '')#> value="" id="" name="" disabled></td>
|
||||||
|
<td>
|
||||||
|
<button data-controls-modal="modal-from-dom" data-backdrop="true" data-keyboard="true"
|
||||||
|
class="btn">edit
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<button class="btn danger">delete</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div id="modal-from-dom" class="modal hide fade" style="width: 577px; max-height: none; top: 35%">
|
||||||
|
<div class="modal-header">
|
||||||
|
<a href="#" class="close">×</a>
|
||||||
|
|
||||||
|
<h3>Edit Client</h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<form>
|
||||||
|
<fieldset>
|
||||||
|
<!--<legend>OpenID Client</legend>-->
|
||||||
|
<div class="clearfix">
|
||||||
|
<label for="xlInput">Client Name</label>
|
||||||
|
|
||||||
|
<div class="input">
|
||||||
|
<input type="text" size="30" name="xlInput" id="xlInput" class="xlarge">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clearfix">
|
||||||
|
<label for="prependedInput">Redirect Url</label>
|
||||||
|
|
||||||
|
<div class="input">
|
||||||
|
<div class="input-prepend">
|
||||||
|
<span class="add-on">http://</span>
|
||||||
|
<input type="text" size="16" name="prependedInput" id="prependedInput" class="medium">
|
||||||
|
</div>
|
||||||
|
<span class="help-block">Url to be redirected</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clearfix">
|
||||||
|
<label id="optionsCheckboxes">Grant Types:</label>
|
||||||
|
|
||||||
|
<div class="input">
|
||||||
|
<ul class="inputs-list">
|
||||||
|
<li>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" value="option1" name="optionsCheckboxes">
|
||||||
|
<span>Grant Type Blah</span>
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" value="option2" name="optionsCheckboxes">
|
||||||
|
<span>Grant Type Blah</span>
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" value="option2" name="optionsCheckboxes">
|
||||||
|
<span>Grant Type Blah</span>
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<span class="help-block">
|
||||||
|
<strong>Note:</strong> Grant type help text.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clearfix">
|
||||||
|
<label for="textarea2">Scope</label>
|
||||||
|
|
||||||
|
<div class="input">
|
||||||
|
<textarea rows="3" name="textarea2" id="textarea2" class="xlarge">email,first name</textarea>
|
||||||
|
<span class="help-block">
|
||||||
|
Please enter scopes separated by commas
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clearfix">
|
||||||
|
<label for="normalSelect">Authority</label>
|
||||||
|
|
||||||
|
<div class="input">
|
||||||
|
<select id="normalSelect" name="normalSelect">
|
||||||
|
<option>My Authority Option 1</option>
|
||||||
|
<option>My Authority Option 2</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<div class="clearfix">
|
||||||
|
<label for="form-description">Description</label>
|
||||||
|
|
||||||
|
<div class="input">
|
||||||
|
<input type="text" size="30" name="form-description" id="form-description" class="xlarge">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="clearfix">
|
||||||
|
<label id="form-allow-tokens">Allow refresh tokens?</label>
|
||||||
|
|
||||||
|
<div class="input">
|
||||||
|
<ul class="inputs-list">
|
||||||
|
<li>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" value="option1" name="form-allow-tokens">
|
||||||
|
<span> </span>
|
||||||
|
</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<span class="help-block">
|
||||||
|
<strong>Note:</strong> Labels surround all the options for much larger click areas and a more usable form.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<a href="#" class="btn primary">Save</a>
|
||||||
|
<a href="#" class="btn secondary">Cancel</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<o:topbar/>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<o:sidebar/>
|
||||||
|
<div class="content">
|
||||||
|
<!-- Main hero unit for a primary marketing message or call to action -->
|
||||||
|
<div class="hero-unit">
|
||||||
|
<h1>Welcome, User Name!</h1>
|
||||||
|
|
||||||
|
<p>Can't remember your passwords? Tired of filling out registration forms?
|
||||||
|
OpenID is a <strong>safe</strong>, <strong>faster</strong>, and <strong>easier</strong> way to log in to
|
||||||
|
web sites.</p>
|
||||||
|
|
||||||
|
<p><a class="btn primary large" href="http://openid.net/connect/">Learn more »</a></p>
|
||||||
|
</div>
|
||||||
|
<!-- Example row of columns -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="span8">
|
||||||
|
<h2>About</h2>
|
||||||
|
|
||||||
|
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo,
|
||||||
|
tortor
|
||||||
|
mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada
|
||||||
|
magna
|
||||||
|
mollis euismod. Donec sed odio dui. </p>
|
||||||
|
|
||||||
|
<p><a class="btn" href="#">More »</a></p>
|
||||||
|
</div>
|
||||||
|
<div class="span8">
|
||||||
|
<h2>Contact</h2>
|
||||||
|
|
||||||
|
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo,
|
||||||
|
tortor
|
||||||
|
mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada
|
||||||
|
magna
|
||||||
|
mollis euismod. Donec sed odio dui. </p>
|
||||||
|
|
||||||
|
<p><a class="btn" href="#">Email »</a></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<!-- Example row of columns -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="span16">
|
||||||
|
<h2>Current Statistics</h2>
|
||||||
|
|
||||||
|
<p>You'll be keen to know that there have been <span class="label notice">4720</span> users of this
|
||||||
|
system who have logged in to
|
||||||
|
<span class="label notice">203</span>
|
||||||
|
total sites, for a total of <span class="label notice">6224</span> site approvals.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<o:copyright/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<o:footer/>
|
|
@ -1,17 +1,15 @@
|
||||||
<%@ page import="org.springframework.security.core.AuthenticationException" %>
|
<%@ page import="org.springframework.security.core.AuthenticationException" %>
|
||||||
<%@ page import="org.springframework.security.oauth2.provider.verification.BasicUserApprovalFilter" %>
|
<%@ page import="org.springframework.security.oauth2.common.exceptions.UnapprovedClientAuthenticationException" %>
|
||||||
<%@ page import="org.springframework.security.oauth2.provider.verification.VerificationCodeFilter" %>
|
|
||||||
<%@ page import="org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter" %>
|
<%@ page import="org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter" %>
|
||||||
<%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %>
|
<%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %>
|
||||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
|
||||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
|
||||||
<%@ taglib prefix="o" tagdir="/WEB-INF/tags" %>
|
<%@ taglib prefix="o" tagdir="/WEB-INF/tags" %>
|
||||||
|
|
||||||
<o:header title="approve access"/>
|
<o:header title="approve access"/>
|
||||||
<o:topbar/>
|
<o:topbar/>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<c:if test="${!empty sessionScope.SPRING_SECURITY_LAST_EXCEPTION}">
|
<% if (session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY) != null && !(session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY) instanceof UnapprovedClientAuthenticationException)) { %>
|
||||||
<div class="alert-message error">
|
<div class="alert-message error">
|
||||||
<a href="#" class="close">×</a>
|
<a href="#" class="close">×</a>
|
||||||
|
|
||||||
|
@ -19,7 +17,7 @@
|
||||||
(<%= ((AuthenticationException) session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %>
|
(<%= ((AuthenticationException) session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %>
|
||||||
)</p>
|
)</p>
|
||||||
</div>
|
</div>
|
||||||
</c:if>
|
<% } %>
|
||||||
<c:remove scope="session" var="SPRING_SECURITY_LAST_EXCEPTION"/>
|
<c:remove scope="session" var="SPRING_SECURITY_LAST_EXCEPTION"/>
|
||||||
|
|
||||||
<authz:authorize ifAllGranted="ROLE_USER">
|
<authz:authorize ifAllGranted="ROLE_USER">
|
||||||
|
@ -32,18 +30,14 @@
|
||||||
<p>
|
<p>
|
||||||
|
|
||||||
<form id="confirmationForm" name="confirmationForm"
|
<form id="confirmationForm" name="confirmationForm"
|
||||||
action="<%=request.getContextPath() + VerificationCodeFilter.DEFAULT_PROCESSING_URL%>"
|
action="<%=request.getContextPath()%>/oauth/authorize" method="post">
|
||||||
method="post">
|
<input name="user_oauth_approval" value="true" type="hidden"/>
|
||||||
<input name="<%=BasicUserApprovalFilter.DEFAULT_APPROVAL_REQUEST_PARAMETER%>"
|
|
||||||
value="<%=BasicUserApprovalFilter.DEFAULT_APPROVAL_PARAMETER_VALUE%>" type="hidden"/>
|
|
||||||
<input name="authorize" value="Authorize" type="submit" class="btn success large"/>
|
<input name="authorize" value="Authorize" type="submit" class="btn success large"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form id="denialForm" name="denialForm"
|
<form id="denialForm" name="denialForm" action="<%=request.getContextPath()%>/oauth/authorize"
|
||||||
action="<%=request.getContextPath() + VerificationCodeFilter.DEFAULT_PROCESSING_URL%>"
|
|
||||||
method="post">
|
method="post">
|
||||||
<input name="<%=BasicUserApprovalFilter.DEFAULT_APPROVAL_REQUEST_PARAMETER%>"
|
<input name="user_oauth_approval" value="false" type="hidden"/>
|
||||||
value="not_<%=BasicUserApprovalFilter.DEFAULT_APPROVAL_PARAMETER_VALUE%>" type="hidden"/>
|
|
||||||
<input name="deny" value="Deny" type="submit" class="btn secondary large"/>
|
<input name="deny" value="Deny" type="submit" class="btn secondary large"/>
|
||||||
</form>
|
</form>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -65,26 +65,26 @@
|
||||||
|
|
||||||
<script type="text/html" id="client_tmpl">
|
<script type="text/html" id="client_tmpl">
|
||||||
<tr>
|
<tr>
|
||||||
<td><%=name%></td>
|
<td><#=name#></td>
|
||||||
<td><%=redirectURL%></td>
|
<td><#=redirectURL#></td>
|
||||||
<td>
|
<td>
|
||||||
<ul>
|
<ul>
|
||||||
<% for (var i in grantType) { %>
|
<# for (var i in grantType) { #>
|
||||||
<li><%=grantType[i]%></li>
|
<li><#=grantType[i]#></li>
|
||||||
<% } %>
|
<# } #>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<ul>
|
<ul>
|
||||||
<% for (var i in scope) { %>
|
<# for (var i in scope) { #>
|
||||||
<li><%=scope[i]%></li>
|
<li><#=scope[i]#></li>
|
||||||
<% } %>
|
<# } #>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
<td><%=authority%></td>
|
<td><#=authority#></td>
|
||||||
<td><%=description%>
|
<td><#=description#>
|
||||||
</td>
|
</td>
|
||||||
<td><input type="checkbox" "<%=(refreshTokens == 1 ? 'checked' : '')%> value="" id="" name="" disabled></td>
|
<td><input type="checkbox" "<#=(refreshTokens == 1 ? 'checked' : '')#> value="" id="" name="" disabled></td>
|
||||||
<td>
|
<td>
|
||||||
<button data-controls-modal="modal-from-dom" data-backdrop="true" data-keyboard="true"
|
<button data-controls-modal="modal-from-dom" data-backdrop="true" data-keyboard="true"
|
||||||
class="btn">edit
|
class="btn">edit
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
var ExampleOpenIdClient = {
|
||||||
|
name:"A name",
|
||||||
|
redirectURL:"http://myURL.domain",
|
||||||
|
grantType:["my grant type 1", "my grant type 2"],
|
||||||
|
scope:["scope 1", "scope 2"],
|
||||||
|
authority:"my authority",
|
||||||
|
description:"my description",
|
||||||
|
refreshTokens:false
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(tmpl('client_tmpl',ExampleOpenIdClient));
|
||||||
|
|
||||||
|
$('#client-table').append(tmpl('client_tmpl',ExampleOpenIdClient));
|
||||||
|
|
||||||
|
});
|
|
@ -1,3 +1,6 @@
|
||||||
|
// A slightly modified version of the Resig Templating library
|
||||||
|
// JSP hates the original
|
||||||
|
|
||||||
// Simple JavaScript Templating
|
// Simple JavaScript Templating
|
||||||
// John Resig - http://ejohn.org/ - MIT Licensed
|
// John Resig - http://ejohn.org/ - MIT Licensed
|
||||||
(function(){
|
(function(){
|
||||||
|
@ -19,13 +22,15 @@
|
||||||
"with(obj){p.push('" +
|
"with(obj){p.push('" +
|
||||||
|
|
||||||
// Convert the template into pure JavaScript
|
// Convert the template into pure JavaScript
|
||||||
str.replace(/[\r\t\n]/g, " ")
|
str
|
||||||
.replace(/'(?=[^%]*%>)/g,"\t")
|
.replace(/[\r\t\n]/g, " ")
|
||||||
|
.replace(/'(?=[^#]*#>)/g, "\t")
|
||||||
.split("'").join("\\'")
|
.split("'").join("\\'")
|
||||||
.split("\t").join("'")
|
.split("\t").join("'")
|
||||||
.replace(/<%=(.+?)%>/g, "',$1,'")
|
.replace(/<#=(.+?)#>/g, "',$1,'")
|
||||||
.split("<%").join("');")
|
.split("<#").join("');")
|
||||||
.split("%>").join("p.push('")
|
.split("#>").join("p.push('")
|
||||||
|
.split("\r").join("\\'")
|
||||||
+ "');}return p.join('');");
|
+ "');}return p.join('');");
|
||||||
|
|
||||||
// Provide some basic currying to the user
|
// Provide some basic currying to the user
|
||||||
|
|
Loading…
Reference in New Issue