Commits

Joeri Sykora  committed 845a505

use jsf for login and authorize pages

  • Participants
  • Parent commits e6b17fa
  • Branches jsf

Comments (0)

Files changed (22)

File oauthconsumer/src/main/resources/META-INF/persistence.xml

     <class>com.lodgon.dali.core.entity.Field</class>
     <class>com.lodgon.dali.core.entity.Group</class>
     <class>com.lodgon.dali.core.entity.GroupPermission</class>
+    <class>com.lodgon.dali.core.entity.Member</class>
     <class>com.lodgon.dali.core.entity.TypePermission</class>
     <class>com.lodgon.dali.core.entity.User</class>
     <class>com.lodgon.dali.core.entity.UserPermission</class>

File oauthprovider/nb-configuration.xml

 Any value defined here will override the pom.xml file value but is only applicable to the current project.
 -->
         <netbeans.compile.on.save>all</netbeans.compile.on.save>
+        <org-netbeans-modules-projectapi.jsf_2e_language>Facelets</org-netbeans-modules-projectapi.jsf_2e_language>
     </properties>
 </project-shared-configuration>

File oauthprovider/src/main/java/com/mycompany/oauthprovider/Authentication.java

+package com.mycompany.oauthprovider;
+
+import com.lodgon.dali.core.ejb.DaliCoreException;
+import com.lodgon.dali.core.ejb.UserBean;
+import com.lodgon.dali.core.entity.User;
+import com.lodgon.dali.core.oauth.ejb.OAuthBean;
+import com.lodgon.dali.core.oauth.entity.DaliToken;
+import com.lodgon.dali.core.oauth.entity.OAuthUser;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ManagedProperty;
+import javax.faces.bean.RequestScoped;
+import javax.inject.Inject;
+
+/**
+ *
+ * @author joeri
+ */
+@ManagedBean
+@RequestScoped
+public class Authentication {
+	@Inject
+	OAuthBean oauthBean;
+	@Inject
+	UserBean userBean;
+
+	private String oauthToken;
+	private String username;
+	private String password;
+
+	@ManagedProperty(value = "#{authorization}")
+	private Authorization authorization;
+
+	public Authorization getAuthorization() {
+		return authorization;
+	}
+
+	public void setAuthorization(Authorization authorization) {
+		this.authorization = authorization;
+	}
+
+	/**
+	 * Creates a new instance of AuthenticationForm
+	 */
+	public Authentication() {
+	}
+
+	public String getOauthToken() {
+		return oauthToken;
+	}
+
+	public void setOauthToken(String oauthToken) {
+		this.oauthToken = oauthToken;
+	}
+
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+
+	public String login() throws DaliCoreException {
+		User user = userBean.validateScreenNameAndPassword(username, password);
+		if (user == null) {
+			user = new OAuthUser();
+			user.setScreenName(username);
+			user = userBean.create(user);
+			userBean.setPassword(user.getId(), password);
+		}
+
+		DaliToken requestToken = oauthBean.findDaliToken(oauthToken, DaliToken.Type.OAUTH_REQUEST_TOKEN);
+
+		authorization.setOauthToken(oauthToken);
+		authorization.setUserUid(user.getUid());
+		authorization.setConsumer(requestToken.getDaliServiceConsumer());
+
+		return "/pages/authorize";
+	}
+}

File oauthprovider/src/main/java/com/mycompany/oauthprovider/Authorization.java

+package com.mycompany.oauthprovider;
+
+import com.lodgon.dali.core.ejb.DaliCoreException;
+import com.lodgon.dali.core.ejb.UserBean;
+import com.lodgon.dali.core.entity.User;
+import com.lodgon.dali.core.oauth.ejb.OAuthBean;
+import com.lodgon.dali.core.oauth.entity.DaliServiceConsumer;
+import com.lodgon.dali.core.oauth.entity.DaliToken;
+import com.sun.jersey.oauth.signature.OAuthParameters;
+import java.io.IOException;
+import java.net.URLEncoder;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.faces.context.FacesContext;
+import javax.inject.Inject;
+
+/**
+ *
+ * @author joeri
+ */
+@ManagedBean
+@SessionScoped
+public class Authorization {
+	@Inject
+	OAuthBean oauthBean;
+	@Inject
+	UserBean userBean;
+
+	private String verifier;
+	private String message;
+	private String oauthToken;
+	private String userUid;
+	private DaliServiceConsumer consumer;
+
+	public String getVerifier() {
+		return verifier;
+	}
+
+	public void setVerifier(String verifier) {
+		this.verifier = verifier;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+
+	public String getOauthToken() {
+		return oauthToken;
+	}
+
+	public void setOauthToken(String oauthToken) {
+		this.oauthToken = oauthToken;
+	}
+
+	public String getUserUid() {
+		return userUid;
+	}
+
+	public void setUserUid(String userUid) {
+		this.userUid = userUid;
+	}
+
+	public DaliServiceConsumer getConsumer() {
+		return consumer;
+	}
+
+	public void setConsumer(DaliServiceConsumer consumer) {
+		this.consumer = consumer;
+	}
+
+	public String allow() throws DaliCoreException, IOException {
+		DaliToken requestToken = oauthBean.findDaliToken(oauthToken, DaliToken.Type.OAUTH_REQUEST_TOKEN);
+
+		User user = userBean.getByUid(userUid);
+		if (user != null) {
+			this.verifier = oauthBean.authorizeServiceConsumer(user.getId(), oauthToken, true);
+			if ("oob".equals(requestToken.getCallback())) {
+				return "/pages/verifier";
+			} else {
+				FacesContext.getCurrentInstance().getExternalContext().redirect(requestToken.getCallback() + "?" + OAuthParameters.TOKEN + "=" + URLEncoder.encode(oauthToken, "UTF-8") + "&" + OAuthParameters.VERIFIER + "=" + URLEncoder.encode(verifier, "UTF-8"));
+			}
+		} else {
+			return "/pages/login";
+		}
+
+		return null;
+	}
+
+	public String deny() throws IOException {
+		DaliToken requestToken = oauthBean.findDaliToken(oauthToken, DaliToken.Type.OAUTH_REQUEST_TOKEN);
+
+		if ("oob".equals(requestToken.getCallback())) {
+			this.verifier = "Denied.";
+			return "/pages/verifier";
+		} else {
+			FacesContext.getCurrentInstance().getExternalContext().redirect(requestToken.getCallback());
+		}
+
+		return null;
+	}
+}

File oauthprovider/src/main/java/com/mycompany/oauthprovider/OAuthHandler.java

-package com.mycompany.oauthprovider;
-
-import com.lodgon.dali.core.ejb.DaliCoreException;
-import com.lodgon.dali.core.ejb.UserBean;
-import com.lodgon.dali.core.entity.User;
-import com.lodgon.dali.core.oauth.ejb.OAuthBean;
-import com.lodgon.dali.core.oauth.entity.DaliServiceConsumer;
-import com.lodgon.dali.core.oauth.entity.DaliToken;
-import com.lodgon.dali.core.oauth.entity.OAuthUser;
-import com.sun.jersey.api.view.Viewable;
-import com.sun.jersey.oauth.signature.OAuthParameters;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URLEncoder;
-import javax.annotation.ManagedBean;
-import javax.inject.Inject;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Response;
-
-@Path("oauth")
-@ManagedBean
-public class OAuthHandler {
-	@Inject
-	OAuthBean oauthBean;
-	@Inject
-	UserBean userBean;
-
-	@GET
-	@Path("authenticate")
-	public Viewable authenticate(@QueryParam("oauth_token") String oauthToken) {
-		return new Viewable("/login.jsp", new Model(oauthToken));
-	}
-
-	@POST
-	@Path("login")
-	public Viewable login(@FormParam("oauth_token") String oauthToken,
-					@FormParam("username") String userName,
-					@FormParam("password") String password) throws DaliCoreException {
-		User user = userBean.validateScreenNameAndPassword(userName, password);
-		if (user == null) {
-			user = new OAuthUser();
-			user.setScreenName(userName);
-			user = userBean.create(user);
-			userBean.setPassword(user.getId(), password);
-		}
-
-		DaliToken requestToken = oauthBean.findDaliToken(oauthToken, DaliToken.Type.OAUTH_REQUEST_TOKEN);
-		return new Viewable("/authorize.jsp", new Model(oauthToken, user, requestToken.getDaliServiceConsumer()));
-	}
-
-	@POST
-	@Path("authorize")
-	public Response authorize(@FormParam("oauth_token") String oauthToken,
-					@FormParam("userUid") String userUid,
-					@DefaultValue("no") @FormParam("authorize") String authorize) throws DaliCoreException, URISyntaxException, UnsupportedEncodingException {
-		DaliToken requestToken = oauthBean.findDaliToken(oauthToken, DaliToken.Type.OAUTH_REQUEST_TOKEN);
-
-		if ("yes".equals(authorize)) {
-			User user = userBean.getByUid(userUid);
-			if (user != null) {
-				String verifier = oauthBean.authorizeServiceConsumer(user.getId(), oauthToken, true);
-				if ("oob".equals(requestToken.getCallback())) {
-					return Response.ok(verifier).build();
-				} else {
-					return Response.seeOther(new URI(requestToken.getCallback() + "?" + OAuthParameters.TOKEN + "=" + URLEncoder.encode(oauthToken, "UTF-8") + "&" + OAuthParameters.VERIFIER + "=" + URLEncoder.encode(verifier, "UTF-8"))).build();
-				}
-			} else {
-				return Response.ok(new Viewable("/login.jsp", new Model(oauthToken))).build();
-			}
-		} else {
-			return Response.seeOther(new URI(requestToken.getCallback())).build();
-		}
-	}
-
-	public static class Model {
-		private String message;
-		private String oauthToken;
-		private DaliServiceConsumer serviceConsumer;
-		private User user;
-
-		public Model(String oauthToken) {
-			this.oauthToken = oauthToken;
-		}
-
-		public Model(String oauthToken, String message) {
-			this.oauthToken = oauthToken;
-			this.message = message;
-		}
-
-		public Model(String oauthToken, User user, DaliServiceConsumer serviceConsumer) {
-			this.oauthToken = oauthToken;
-			this.user = user;
-			this.serviceConsumer = serviceConsumer;
-		}
-
-		public String getMessage() {
-			return message;
-		}
-
-		public void setMessage(String message) {
-			this.message = message;
-		}
-
-		public String getOauthToken() {
-			return oauthToken;
-		}
-
-		public void setOauthToken(String oauthToken) {
-			this.oauthToken = oauthToken;
-		}
-
-		public DaliServiceConsumer getServiceConsumer() {
-			return serviceConsumer;
-		}
-
-		public void setServiceConsumer(DaliServiceConsumer serviceConsumer) {
-			this.serviceConsumer = serviceConsumer;
-		}
-
-		public User getUser() {
-			return user;
-		}
-
-		public void setUser(User user) {
-			this.user = user;
-		}
-	}
-}

File oauthprovider/src/main/resources/META-INF/persistence.xml

     <class>com.lodgon.dali.core.entity.Field</class>
     <class>com.lodgon.dali.core.entity.Group</class>
     <class>com.lodgon.dali.core.entity.GroupPermission</class>
+    <class>com.lodgon.dali.core.entity.Member</class>
     <class>com.lodgon.dali.core.entity.TypePermission</class>
     <class>com.lodgon.dali.core.entity.User</class>
     <class>com.lodgon.dali.core.entity.UserPermission</class>
     <class>com.lodgon.dali.core.oauth.entity.DaliServiceConsumer</class>
     <class>com.lodgon.dali.core.oauth.entity.OAuthUser</class>
     <exclude-unlisted-classes>false</exclude-unlisted-classes>
+		<properties>
+			<property name="eclipselink.ddl-generation" value="create-tables"/>
+		</properties>
   </persistence-unit>
 </persistence>

File oauthprovider/src/main/webapp/WEB-INF/faces-config.xml

+<?xml version='1.0' encoding='UTF-8'?>
+
+<!-- =========== FULL CONFIGURATION FILE ================================== -->
+
+<faces-config version="2.0"
+    xmlns="http://java.sun.com/xml/ns/javaee" 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+
+
+</faces-config>

File oauthprovider/src/main/webapp/WEB-INF/web.xml

 				 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 				 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
 				 version="3.0">
+	<context-param>
+		<param-name>javax.faces.PROJECT_STAGE</param-name>
+		<param-value>Development</param-value>
+	</context-param>
+
 	<servlet>
 			<servlet-name>Faces Servlet</servlet-name>
 			<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
 			<load-on-startup>1</load-on-startup>
 	</servlet>
 
-	<servlet>
-		<servlet-name>jerseyservlet</servlet-name>
-		<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
-		<init-param>
-			<param-name>com.sun.jersey.config.property.oauth.ignorePathPattern</param-name>
-			<param-value>requestToken|accessToken</param-value>
-		</init-param>
-		<init-param>
-			<param-name>com.sun.jersey.config.property.packages</param-name>
-			<param-value>com.sun.jersey.oauth.server.api.resources;com.lodgon.dali.core.oauth;com.mycompany.oauthprovider</param-value>
-		</init-param>
-	</servlet>
-
 	<servlet-mapping>
 			<servlet-name>Faces Servlet</servlet-name>
 			<url-pattern>/faces/*</url-pattern>
-	</servlet-mapping>
-	<servlet-mapping>
-		<servlet-name>jerseyservlet</servlet-name>
-		<url-pattern>/rest/*</url-pattern>
+			<url-pattern>*.faces</url-pattern>
 	</servlet-mapping>
 
 	<session-config>
 			30
 		</session-timeout>
 	</session-config>
+
+	<welcome-file-list>
+		<welcome-file>index.jsp</welcome-file>
+	</welcome-file-list>
 </web-app>

File oauthprovider/src/main/webapp/authorize.jsp

-<%@page contentType="text/html" pageEncoding="UTF-8"%>
-<!DOCTYPE html>
-<html>
-	<head>
-		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-		<title>dalicore-oauth service provider</title>
-	</head>
-	<body>
-		<h1>Authorize</h1>
-
-		<h4>Do you want to allow the service consumer <b>${it.serviceConsumer.name}</b> to access your data:</h4>
-
-		<form method="POST" action="${pageContext.request.contextPath}/rest/oauth/authorize">
-			<input type="hidden" name="oauth_token" value="${it.oauthToken}"/>
-			<input type="hidden" name="userUid" value="${it.user.uid}"/>
-			<input type="submit" name="authorize" value="yes"/>
-			<input type="submit" name="authorize" value="no"/>
-		</form>
-	</body>
-</html>

File oauthprovider/src/main/webapp/decorators/header.xhtml

+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+			xmlns:ui="http://java.sun.com/jsf/facelets">
+	<h:head>
+		<title>Facelet Title</title>
+	</h:head>
+	<h:body>
+		<ui:composition>
+			<ui:insert/>
+		</ui:composition>
+	</h:body>
+</html>
+

File oauthprovider/src/main/webapp/index.jsp

+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+<c:redirect url="pages/login.faces"/>

File oauthprovider/src/main/webapp/login.jsp

-<%@page contentType="text/html" pageEncoding="UTF-8"%>
-
-<!DOCTYPE html>
-<html lang="en"
-      xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:h="http://java.sun.com/jsf/html"
-			xmlns:c="http://java.sun.com/jsf/core">
-	<h:head>
-		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-		<title>dalicore-oauth service provider</title>
-	</h:head>
-	<h:body>
-		<h1>Authenticate</h1>
-
-		<h:form method="POST" action="${pageContext.request.contextPath}/rest/oauth/login">
-			<h:inputHidden id="oauth_token" value="#{it.oauthToken}"/>
-			<h:inputText id="username" label="username"/><br/>
-			<h:inputSecret id="password" label="password"/><br/>
-			<h:commandButton value="loging" action="#{oauthBean.login}"/>
-		</h:form>
-	</h:body>
-</html>

File oauthprovider/src/main/webapp/pages/authorize.xhtml

+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+			xmlns:ui="http://java.sun.com/jsf/facelets">
+	<h:head>
+		<title>Facelet title</title>
+	</h:head>
+	<h:body>
+		<ui:composition template="/templates/main.xhtml">
+			<ui:define name="heading">
+				<ui:include src="/sections/authorize/header.xhtml"/>
+			</ui:define>
+
+			<ui:define name="content">
+				<ui:include src="/sections/authorize/content.xhtml"/>
+			</ui:define>
+		</ui:composition>
+	</h:body>
+</html>
+

File oauthprovider/src/main/webapp/pages/login.xhtml

+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+			xmlns:ui="http://java.sun.com/jsf/facelets">
+	<h:head>
+		<title>Facelet title</title>
+	</h:head>
+	<h:body>
+		<ui:composition template="/templates/main.xhtml">
+			<ui:define name="heading">
+				<ui:include src="/sections/login/header.xhtml"/>
+			</ui:define>
+
+			<ui:define name="content">
+				<ui:include src="/sections/login/content.xhtml"/>
+			</ui:define>
+		</ui:composition>
+	</h:body>
+</html>
+

File oauthprovider/src/main/webapp/pages/oob.xhtml

+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+			xmlns:ui="http://java.sun.com/jsf/facelets">
+	<h:head>
+		<title>Facelet title</title>
+	</h:head>
+	<h:body>
+		<ui:composition template="/templates/main.xhtml">
+			<ui:define name="heading">
+				<ui:include src="/sections/oob/header.xhtml"/>
+			</ui:define>
+
+			<ui:define name="content">
+				#{authorization.verifier}
+			</ui:define>
+		</ui:composition>
+	</h:body>
+</html>
+

File oauthprovider/src/main/webapp/sections/authorize/content.xhtml

+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+			xmlns:ui="http://java.sun.com/jsf/facelets">
+	<h:head>
+		<title>Facelet Title</title>
+	</h:head>
+	<h:body>
+		<ui:composition>
+			<h4>Do you want to allow the service consumer <b>#{authorization.consumer.name}</b> to access your data:</h4>
+
+			<h:form id="form">
+				<h:inputHidden id="oauth_token" value="#{authorization.oauthToken}"/>
+				<h:inputHidden id="user_uid" value="#{authorization.userUid}"/>
+				<h:commandButton value="Yes" action="#{authorization.authorize}"/>
+				<h:commandButton value="No" action="#{authorization.reject}"/>
+			</h:form>
+		</ui:composition>
+	</h:body>
+</html>
+

File oauthprovider/src/main/webapp/sections/authorize/header.xhtml

+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+			xmlns:ui="http://java.sun.com/jsf/facelets">
+	<h:head>
+		<title>Facelet Title</title>
+	</h:head>
+	<h:body>
+		<ui:composition>
+			<h1>Authorize</h1>
+		</ui:composition>
+	</h:body>
+</html>
+

File oauthprovider/src/main/webapp/sections/login/content.xhtml

+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+			xmlns:ui="http://java.sun.com/jsf/facelets">
+	<h:head>
+		<title>Facelet Title</title>
+	</h:head>
+	<h:body>
+		<ui:composition>
+			<h:form id="form">
+				<h:inputHidden id="oauth_token" value="#{authentication.oauthToken}"/>
+				Username: <h:inputText id="username" value="#{authentication.username}"/><br/>
+				Password: <h:inputSecret id="password" value="#{authentication.password}"/><br/>
+				<h:commandButton value="login" action="#{authentication.login}"/>
+			</h:form>
+		</ui:composition>
+	</h:body>
+</html>
+

File oauthprovider/src/main/webapp/sections/login/header.xhtml

+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+			xmlns:ui="http://java.sun.com/jsf/facelets">
+	<h:head>
+		<title>Facelet Title</title>
+	</h:head>
+	<h:body>
+		<ui:composition>
+			<h1>Authenticate</h1>
+		</ui:composition>
+	</h:body>
+</html>
+

File oauthprovider/src/main/webapp/sections/oob/content.xhtml

+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+			xmlns:ui="http://java.sun.com/jsf/facelets">
+	<h:head>
+		<title>Facelet Title</title>
+	</h:head>
+	<h:body>
+		<ui:composition>
+			<p>Paste this verifier into your application window.</p>
+
+			<p><code>#{authorization.verifier}</code></p>
+		</ui:composition>
+	</h:body>
+</html>
+

File oauthprovider/src/main/webapp/sections/oob/header.xhtml

+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+			xmlns:ui="http://java.sun.com/jsf/facelets">
+	<h:head>
+		<title>Facelet Title</title>
+	</h:head>
+	<h:body>
+		<ui:composition>
+			<h1>Verifier</h1>
+		</ui:composition>
+	</h:body>
+</html>
+

File oauthprovider/src/main/webapp/templates/main.xhtml

+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:h="http://java.sun.com/jsf/html"
+      xmlns:ui="http://java.sun.com/jsf/facelets">
+	<h:head>
+		<title>dalicore-oauth service provider</title>
+	</h:head>
+	<h:body>
+		<ui:decorate template="/decorators/header.xhtml">
+			<ui:insert name="heading"/>
+		</ui:decorate>
+
+		<ui:insert name="content"/>
+	</h:body>
+</html>
+