From f3e53386f94a4ea0bb2d4fe4f79707f243cb0bca Mon Sep 17 00:00:00 2001 From: Michael Jett Date: Mon, 12 Mar 2012 12:50:13 -0400 Subject: [PATCH 1/3] Updating approval page to use oauth2 libs --- .../webapp/WEB-INF/views/oauth/approve.jsp | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/server/src/main/webapp/WEB-INF/views/oauth/approve.jsp b/server/src/main/webapp/WEB-INF/views/oauth/approve.jsp index 48230c836..f27f5ac1a 100644 --- a/server/src/main/webapp/WEB-INF/views/oauth/approve.jsp +++ b/server/src/main/webapp/WEB-INF/views/oauth/approve.jsp @@ -1,25 +1,23 @@ <%@ page import="org.springframework.security.core.AuthenticationException" %> -<%@ page import="org.springframework.security.oauth2.provider.verification.BasicUserApprovalFilter" %> -<%@ page import="org.springframework.security.oauth2.provider.verification.VerificationCodeFilter" %> +<%@ page import="org.springframework.security.oauth2.common.exceptions.UnapprovedClientAuthenticationException" %> <%@ 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/jstl/core_rt" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <%@ taglib prefix="o" tagdir="/WEB-INF/tags" %>
- -
- × + <% if (session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY) != null && !(session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY) instanceof UnapprovedClientAuthenticationException)) { %> +
+ × -

Access could not be granted. - (<%= ((AuthenticationException) session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %> - )

-
- +

Access could not be granted. + (<%= ((AuthenticationException) session.getAttribute(AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %> + )

+
+ <% } %> @@ -32,18 +30,14 @@

- + action="<%=request.getContextPath()%>/oauth/authorize" method="post"> +
  -
- +

From c015329e5273216f17a88aba870f4f01524134b6 Mon Sep 17 00:00:00 2001 From: Michael Jett Date: Tue, 13 Mar 2012 16:27:21 -0400 Subject: [PATCH 2/3] Altering resig js tmpl library. JSP has a hate passion for it. --- .../resources/admin/manage_clients.html | 22 +++++++++---------- server/src/main/webapp/resources/js/tmpl.js | 21 +++++++++++------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/server/src/main/webapp/resources/admin/manage_clients.html b/server/src/main/webapp/resources/admin/manage_clients.html index 7773a1b06..1a255cda6 100644 --- a/server/src/main/webapp/resources/admin/manage_clients.html +++ b/server/src/main/webapp/resources/admin/manage_clients.html @@ -65,26 +65,26 @@ + + + @@ -24,9 +27,6 @@ - +
+ + +
+ +
+
+ +
+ + +
+
+ http:// + +
+ Url to be redirected +
+
+ +
+ + +
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
+ + Note: Grant type help text. + +
+
+ +
+ + +
+ + + Please enter scopes separated by commas + +
+
+ +
+ + +
+ +
+
+ + + +
+ + +
+ +
+
+ +
+ + +
+
    +
  • + +
  • +
+ + Note: Labels surround all the options for much larger click areas and a more usable form. + +
+
+ + +
+ +
+ + +
+ +
+ +
+

Welcome, User Name!

+ +

Can't remember your passwords? Tired of filling out registration forms? + OpenID is a safe, faster, and easier way to log in to + web sites.

+ +

Learn more »

+
+ +
+
+

About

+ +

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.

+ +

More »

+
+
+

Contact

+ +

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.

+ +

Email »

+
+ +
+
+ +
+
+

Current Statistics

+ +

You'll be keen to know that there have been 4720 users of this + system who have logged in to + 203 + total sites, for a total of 6224 site approvals.

+ +
+
+ + +
+
+ diff --git a/server/src/main/webapp/resources/js/app.js b/server/src/main/webapp/resources/js/app.js new file mode 100644 index 000000000..c5451c320 --- /dev/null +++ b/server/src/main/webapp/resources/js/app.js @@ -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)); + +}); \ No newline at end of file