oltu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject svn commit: r1733367 - in /oltu/trunk/demos/client-demo/src/main: java/org/apache/oltu/oauth2/client/demo/ java/org/apache/oltu/oauth2/client/demo/controller/ webapp/WEB-INF/views/ webapp/WEB-INF/views/components/
Date Wed, 02 Mar 2016 20:53:36 GMT
Author: jasha
Date: Wed Mar  2 20:53:35 2016
New Revision: 1733367

URL: http://svn.apache.org/viewvc?rev=1733367&view=rev
Log:
OLTU-193 Add examples for scopes and resource endpoints to demonstrate the full flow

Added:
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/components/
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/components/_header.jsp   (with
props)
Modified:
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
    oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/register.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp
    oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/resource.jsp

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java?rev=1733367&r1=1733366&r2=1733367&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/Utils.java
Wed Mar  2 20:53:35 2016
@@ -60,18 +60,26 @@ public final class Utils {
     public static final String FACEBOOK = OAuthProviderType.FACEBOOK.getProviderName();
     public static final String FACEBOOK_AUTHZ = OAuthProviderType.FACEBOOK.getAuthzEndpoint();
     public static final String FACEBOOK_TOKEN = OAuthProviderType.FACEBOOK.getTokenEndpoint();
+    public static final String FACEBOOK_SCOPE = "public_profile";
+    public static final String FACEBOOK_RESOURCE_URL = "https://graph.facebook.com/me";
 
     public static final String GOOGLE = OAuthProviderType.GOOGLE.getProviderName();
     public static final String GOOGLE_AUTHZ = OAuthProviderType.GOOGLE.getAuthzEndpoint();
     public static final String GOOGLE_TOKEN = OAuthProviderType.GOOGLE.getTokenEndpoint();
+    public static final String GOOGLE_SCOPE = "openid profile";
+    public static final String GOOGLE_RESOURCE_URL = "https://www.googleapis.com/oauth2/v3/userinfo";
 
     public static final String LINKEDIN = OAuthProviderType.LINKEDIN.getProviderName();
     public static final String LINKEDIN_AUTHZ = OAuthProviderType.LINKEDIN.getAuthzEndpoint();
     public static final String LINKEDIN_TOKEN = OAuthProviderType.LINKEDIN.getTokenEndpoint();
+    public static final String LINKEDIN_SCOPE = "r_basicprofile";
+    public static final String LINKEDIN_RESOURCE_URL = "https://www.linkedin.com/v1/people/~";
 
     public static final String GITHUB = OAuthProviderType.GITHUB.getProviderName();
     public static final String GITHUB_AUTHZ = OAuthProviderType.GITHUB.getAuthzEndpoint();
     public static final String GITHUB_TOKEN = OAuthProviderType.GITHUB.getTokenEndpoint();
+    public static final String GITHUB_SCOPE = "";
+    public static final String GITHUB_RESOURCE_URL = "https://api.github.com/user";
 
     public static final String SMART_GALLERY = "smart_gallery";
     public static final String SMART_GALLERY_AUTHZ = "http://localhost:8090/oauth/authorize";

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java?rev=1733367&r1=1733366&r2=1733367&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/MainController.java
Wed Mar  2 20:53:35 2016
@@ -37,7 +37,6 @@ import org.springframework.web.bind.anno
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.servlet.ModelAndView;
 
-import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 
 /**
@@ -54,45 +53,38 @@ public class MainController {
 
     @RequestMapping("/index")
     public ModelAndView authorize(@ModelAttribute("oauthParams") OAuthParams oauthParams)
-        throws OAuthSystemException, IOException {
+            throws OAuthSystemException, IOException {
         return new ModelAndView("index");
     }
 
     @RequestMapping("/main/{app}")
     public ModelAndView authorize(@ModelAttribute("oauthParams") OAuthParams oauthParams,
                                   @ModelAttribute("oauthRegParams") OAuthRegParams oauthRegParams,
-                                  @PathVariable("app") String app,
-                                  HttpServletResponse res)
-        throws OAuthSystemException, IOException {
+                                  @PathVariable("app") String app)
+            throws OAuthSystemException, IOException {
+
+        if (Utils.SMART_GALLERY.equalsIgnoreCase(app)) {
+            addRegParamsForSmartGallery(oauthRegParams);
+            return new ModelAndView("register");
+        }
 
         boolean selected = false;
         if (Utils.GENERIC.equalsIgnoreCase(app)) {
             selected = true;
         } else if (Utils.GITHUB.equalsIgnoreCase(app)) {
             selected = true;
-            oauthParams.setAuthzEndpoint(Utils.GITHUB_AUTHZ);
-            oauthParams.setTokenEndpoint(Utils.GITHUB_TOKEN);
+            addGithubParams(oauthParams);
         } else if (Utils.FACEBOOK.equalsIgnoreCase(app)) {
             selected = true;
-            oauthParams.setAuthzEndpoint(Utils.FACEBOOK_AUTHZ);
-            oauthParams.setTokenEndpoint(Utils.FACEBOOK_TOKEN);
+            addFacebookParams(oauthParams);
         } else if (Utils.GOOGLE.equalsIgnoreCase(app)) {
             selected = true;
-            oauthParams.setAuthzEndpoint(Utils.GOOGLE_AUTHZ);
-            oauthParams.setTokenEndpoint(Utils.GOOGLE_TOKEN);
+            addGoogleParams(oauthParams);
         } else if (Utils.LINKEDIN.equalsIgnoreCase(app)) {
             selected = true;
-            oauthParams.setAuthzEndpoint(Utils.LINKEDIN_AUTHZ);
-            oauthParams.setTokenEndpoint(Utils.LINKEDIN_TOKEN);
-        } else if (Utils.SMART_GALLERY.equalsIgnoreCase(app)) {
-            selected = true;
-            oauthRegParams.setAuthzEndpoint(Utils.SMART_GALLERY_AUTHZ);
-            oauthRegParams.setTokenEndpoint(Utils.SMART_GALLERY_TOKEN);
-            oauthRegParams.setRegistrationEndpoint(Utils.SMART_GALLERY_REGISTER);
-            oauthRegParams.setApplication(app);
-            oauthRegParams.setRedirectUri(utils.getRedirectUri());
-            return new ModelAndView("register");
+            addLinkedInParams(oauthParams);
         }
+
         if (selected) {
             oauthParams.setApplication(app);
             oauthParams.setRedirectUri(utils.getRedirectUri());
@@ -102,14 +94,46 @@ public class MainController {
         return new ModelAndView("index");
     }
 
+    private void addRegParamsForSmartGallery(OAuthRegParams oauthRegParams) {
+        oauthRegParams.setAuthzEndpoint(Utils.SMART_GALLERY_AUTHZ);
+        oauthRegParams.setTokenEndpoint(Utils.SMART_GALLERY_TOKEN);
+        oauthRegParams.setRegistrationEndpoint(Utils.SMART_GALLERY_REGISTER);
+        oauthRegParams.setApplication(Utils.SMART_GALLERY);
+        oauthRegParams.setRedirectUri(utils.getRedirectUri());
+    }
+
+    private void addLinkedInParams(OAuthParams oauthParams) {
+        oauthParams.setAuthzEndpoint(Utils.LINKEDIN_AUTHZ);
+        oauthParams.setTokenEndpoint(Utils.LINKEDIN_TOKEN);
+        oauthParams.setScope(Utils.LINKEDIN_SCOPE);
+    }
+
+    private void addGoogleParams(OAuthParams oauthParams) {
+        oauthParams.setAuthzEndpoint(Utils.GOOGLE_AUTHZ);
+        oauthParams.setTokenEndpoint(Utils.GOOGLE_TOKEN);
+        oauthParams.setScope(Utils.GOOGLE_SCOPE);
+    }
+
+    private void addFacebookParams(OAuthParams oauthParams) {
+        oauthParams.setAuthzEndpoint(Utils.FACEBOOK_AUTHZ);
+        oauthParams.setTokenEndpoint(Utils.FACEBOOK_TOKEN);
+        oauthParams.setScope(Utils.FACEBOOK_SCOPE);
+    }
+
+    private void addGithubParams(OAuthParams oauthParams) {
+        oauthParams.setAuthzEndpoint(Utils.GITHUB_AUTHZ);
+        oauthParams.setTokenEndpoint(Utils.GITHUB_TOKEN);
+        oauthParams.setScope(Utils.GITHUB_SCOPE);
+    }
+
     @RequestMapping("/decode")
-    public ModelAndView decode(@ModelAttribute("oauthParams") OAuthParams oauthParams){
+    public ModelAndView decode(@ModelAttribute("oauthParams") OAuthParams oauthParams) {
         try {
             JWT jwt = jwtReader.read(oauthParams.getJwt());
 
             oauthParams.setHeader(new JWTHeaderWriter().write(jwt.getHeader()));
             oauthParams.setClaimsSet(new JWTClaimsSetWriter().write(jwt.getClaimsSet()));
-        } catch (Exception e){
+        } catch (Exception e) {
             logger.error("Error while decoding the token", e);
             oauthParams.setErrorMessage("Error while decoding the token: " + e);
         }

Modified: oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java?rev=1733367&r1=1733366&r2=1733367&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
(original)
+++ oltu/trunk/demos/client-demo/src/main/java/org/apache/oltu/oauth2/client/demo/controller/TokenController.java
Wed Mar  2 20:53:35 2016
@@ -80,10 +80,15 @@ public class TokenController {
 
             if (Utils.FACEBOOK.equalsIgnoreCase(app)) {
                 cl = GitHubTokenResponse.class;
+                oauthParams.setResourceUrl(Utils.FACEBOOK_RESOURCE_URL);
             } else if (Utils.GITHUB.equalsIgnoreCase(app)) {
                 cl = GitHubTokenResponse.class;
-            } else if (Utils.GOOGLE.equalsIgnoreCase(app)){
+                oauthParams.setResourceUrl(Utils.GITHUB_RESOURCE_URL);
+            } else if (Utils.GOOGLE.equalsIgnoreCase(app)) {
                 cl = OpenIdConnectResponse.class;
+                oauthParams.setResourceUrl(Utils.GOOGLE_RESOURCE_URL);
+            } else if (Utils.LINKEDIN.equalsIgnoreCase(app)) {
+                oauthParams.setResourceUrl(Utils.LINKEDIN_RESOURCE_URL);
             }
 
             OAuthAccessTokenResponse oauthResponse = client.accessToken(request, cl);
@@ -92,8 +97,8 @@ public class TokenController {
             oauthParams.setExpiresIn(oauthResponse.getExpiresIn());
             oauthParams.setRefreshToken(Utils.isIssued(oauthResponse.getRefreshToken()));
 
-            if (Utils.GOOGLE.equalsIgnoreCase(app)){
-                OpenIdConnectResponse openIdConnectResponse = ((OpenIdConnectResponse)oauthResponse);
+            if (Utils.GOOGLE.equalsIgnoreCase(app)) {
+                OpenIdConnectResponse openIdConnectResponse = ((OpenIdConnectResponse) oauthResponse);
                 JWT idToken = openIdConnectResponse.getIdToken();
                 oauthParams.setIdToken(idToken.getRawString());
 

Added: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/components/_header.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/components/_header.jsp?rev=1733367&view=auto
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/components/_header.jsp (added)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/components/_header.jsp Wed
Mar  2 20:53:35 2016
@@ -0,0 +1,30 @@
+<%--
+
+          Copyright 2010 Newcastle University
+
+             http://research.ncl.ac.uk/smart/
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+--%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<div class="jumbotron">
+    <div class="container">
+        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
+        <h1>Apache Oltu</h1>
+        <p>Sample OAuth V2.0 Client Application</p>
+    </div>
+</div>
\ No newline at end of file

Propchange: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/components/_header.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/components/_header.jsp
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp?rev=1733367&r1=1733366&r2=1733367&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_authz.jsp Wed Mar  2 20:53:35
2016
@@ -34,13 +34,7 @@
   </head>
 
   <body>
-    <div class="jumbotron">
-      <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
-        <h1>Apache Oltu</h1>
-        <p>Sample OAuth V2.0 Client Application</p>
-      </div>
-    </div>
+    <jsp:include page="components/_header.jsp"/>
 
     <div class="container">
       <div class="page-header">
@@ -53,7 +47,7 @@
       </c:if>
 
       <c:url var="actionUrl" value="/authorize"/>
-      <form:form class="form-horizontal" role="form" commandName="oauthParams" action="${actionUrl}">
+      <form:form class="form-horizontal clearfix" role="form" commandName="oauthParams"
action="${actionUrl}">
         <div class="form-group">
           <label for="scope" class="col-lg-3 control-label">Requested Access Scope</label>
           <div class="col-lg-9"><form:input class="form-control" id="scope" path="scope"
/></div>

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp?rev=1733367&r1=1733366&r2=1733367&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/get_resource.jsp Wed Mar  2
20:53:35 2016
@@ -34,13 +34,7 @@
   </head>
 
   <body>
-    <div class="jumbotron">
-      <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
-        <h1>Apache Oltu</h1>
-        <p>Sample OAuth V2.0 Client Application</p>
-      </div>
-    </div>
+    <jsp:include page="components/_header.jsp"/>
 
     <div class="container">
       <div class="page-header">
@@ -54,7 +48,8 @@
 
       <c:url var="actionUrl" value="/get_resource"/>
 
-      <form:form class="form-horizontal" role="form" commandName="oauthParams" action="${actionUrl}">
+      <div class="container">
+      <form:form class="form-horizontal clearfix" role="form" commandName="oauthParams"
action="${actionUrl}">
         <div class="form-group">
           <label for="resourceUrl" class="col-lg-3 control-label">Resource URL</label>
           <div class="col-lg-9"><form:input class="form-control" id="resourceUrl"
path="resourceUrl" /></div>
@@ -122,36 +117,34 @@
         <form:hidden path="application" />
         <input type="submit" class="btn btn-primary pull-right" value="Get Resource" />
       </form:form>
+      </div>
 
-      <form:form commandName="oauthParams" action="${actionUrl}">
-        <h4>OpenId Connect</h4>
+      <div class="container">
 
-        <c:if test="${oauthParams.idTokenValid}">
-          <div class="panel panel-success">
+        <c:if test="${!oauthParams.idTokenValid}">
+          <div class="panel panel-danger">
             <div class="panel-heading">
               <h3 class="panel-title">OpenId Connect</h3>
             </div>
-            <div class="panel-body">ID Token is valid</div>
+            <div class="panel-body">ID Token is NOT valid</div>
           </div>
         </c:if>
 
-        <c:if test="${!oauthParams.idTokenValid}">
+        <c:if test="${oauthParams.idTokenValid}">
           <div class="panel panel-success">
             <div class="panel-heading">
               <h3 class="panel-title">OpenId Connect</h3>
             </div>
-            <div class="panel-body">ID Token is NOT valid</div>
+            <div class="panel-body">ID Token is valid</div>
           </div>
         </c:if>
 
         <c:if test="${!empty oauthParams.header}">
-          <div class="clearfix">&nbsp;<br/>&nbsp;</div>
-
           <div class="panel panel-default">
             <div class="panel-heading">
               <h3 class="panel-title">Header</h3>
             </div>
-            <div class="panel-body">${oauthParams.header}</div>
+            <div class="panel-body"><pre><c:out value="${oauthParams.header}"/></pre></div>
           </div>
         </c:if>
 
@@ -160,10 +153,10 @@
             <div class="panel-heading">
               <h3 class="panel-title">Claims Set</h3>
             </div>
-            <pre class="panel-body"><c:out value="${oauthParams.claimsSet}"/></pre>
+            <div class="panel-body"><pre><c:out value="${oauthParams.claimsSet}"/></pre></div>
           </div>
         </c:if>
-      </form:form>
+      </div>
 
     </div>
   </body>

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp?rev=1733367&r1=1733366&r2=1733367&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/index.jsp Wed Mar  2 20:53:35
2016
@@ -34,13 +34,7 @@
   </head>
 
   <body>
-    <div class="jumbotron">
-      <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
-        <h1>Apache Oltu</h1>
-        <p>Sample OAuth V2.0 Client Application</p>
-      </div>
-    </div>
+    <jsp:include page="components/_header.jsp"/>
 
     <div class="container">
       <div class="page-header"><h2>Web Server Flow <small>Choose Application</small></h2></div>
@@ -65,7 +59,7 @@
       </c:if>
 
       <c:url var="actionUrl" value="/decode"/>
-      <form:form role="form" commandName="oauthParams" action="${actionUrl}">
+      <form:form role="form" commandName="oauthParams" cssClass="form-horizontal clearfix"
action="${actionUrl}">
         <form:textarea path="jwt" id="jwt" rows="15" class="form-control" />
         <form:hidden path="application" />
         <div class="clearfix">&nbsp;<br/></div>

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/register.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/register.jsp?rev=1733367&r1=1733366&r2=1733367&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/register.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/register.jsp Wed Mar  2 20:53:35
2016
@@ -34,13 +34,7 @@
   </head>
 
   <body>
-    <div class="jumbotron">
-      <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
-        <h1>Apache Oltu</h1>
-        <p>Sample OAuth V2.0 Client Application</p>
-      </div>
-    </div>
+  <jsp:include page="components/_header.jsp"/>
 
     <div class="container">
       <div class="page-header">

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp?rev=1733367&r1=1733366&r2=1733367&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/request_token.jsp Wed Mar 
2 20:53:35 2016
@@ -34,13 +34,7 @@
   </head>
 
   <body>
-    <div class="jumbotron">
-      <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
-        <h1>Apache Oltu</h1>
-        <p>Sample OAuth V2.0 Client Application</p>
-      </div>
-    </div>
+    <jsp:include page="components/_header.jsp"/>
 
     <div class="container">
       <div class="page-header">
@@ -53,7 +47,7 @@
       </c:if>
 
       <c:url var="actionUrl" value="/get_token"/>
-      <form:form commandName="oauthParams" action="${actionUrl}">
+      <form:form commandName="oauthParams" cssClass="form-horizontal clearfix" action="${actionUrl}">
         <div class="form-group">
           <label for="authzCode" class="col-lg-3 control-label">Authorization Code</label>
           <div class="col-lg-9"><form:input class="form-control" id="authzCode"
path="authzCode" /></div>

Modified: oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/resource.jsp
URL: http://svn.apache.org/viewvc/oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/resource.jsp?rev=1733367&r1=1733366&r2=1733367&view=diff
==============================================================================
--- oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/resource.jsp (original)
+++ oltu/trunk/demos/client-demo/src/main/webapp/WEB-INF/views/resource.jsp Wed Mar  2 20:53:35
2016
@@ -34,13 +34,7 @@
   </head>
 
   <body>
-    <div class="jumbotron">
-      <div class="container">
-        <img alt="Apache Oltu - Sample OAuth V2.0 Client Application" src="<c:url value="/images/logo_oltu.png"/>"
/>
-        <h1>Apache Oltu</h1>
-        <p>Sample OAuth V2.0 Client Application</p>
-      </div>
-    </div>
+    <jsp:include page="components/_header.jsp"/>
 
     <div class="container">
       <div class="page-header">
@@ -52,9 +46,10 @@
       <div class="alert alert-danger">${oauthParams.errorMessage}</div>
       </c:if>
 
-      <div class="panel panel-default">
-        <pre class="panel-body"><c:out value="${oauthParams.resource}"/></pre>
-      </div>
+      <pre><c:out value="${oauthParams.resource}"/></pre>
+
+      <hr/>
+      <a class="btn btn-default" role="button" href="<c:url value="/"/>">Restart
flow</a>
     </div>
   </body>
 </html>



Mime
View raw message