Author: fmeschbe
Date: Fri Aug 20 09:22:42 2010
New Revision: 987426
URL: http://svn.apache.org/viewvc?rev=987426&view=rev
Log:
SLING-1370 First implementation of an authentication selector pseudo
authentication handler
Added:
sling/trunk/bundles/auth/selector/ (with props)
sling/trunk/bundles/auth/selector/pom.xml (with props)
sling/trunk/bundles/auth/selector/src/
sling/trunk/bundles/auth/selector/src/main/
sling/trunk/bundles/auth/selector/src/main/java/
sling/trunk/bundles/auth/selector/src/main/java/org/
sling/trunk/bundles/auth/selector/src/main/java/org/apache/
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorAuthenticationHandler.java
(with props)
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorFormServlet.java
(with props)
sling/trunk/bundles/auth/selector/src/main/resources/
sling/trunk/bundles/auth/selector/src/main/resources/org/
sling/trunk/bundles/auth/selector/src/main/resources/org/apache/
sling/trunk/bundles/auth/selector/src/main/resources/org/apache/sling/
sling/trunk/bundles/auth/selector/src/main/resources/org/apache/sling/auth/
sling/trunk/bundles/auth/selector/src/main/resources/org/apache/sling/auth/selector/
sling/trunk/bundles/auth/selector/src/main/resources/org/apache/sling/auth/selector/login.html
(with props)
Propchange: sling/trunk/bundles/auth/selector/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Aug 20 09:22:42 2010
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target
Added: sling/trunk/bundles/auth/selector/pom.xml
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/auth/selector/pom.xml?rev=987426&view=auto
==============================================================================
--- sling/trunk/bundles/auth/selector/pom.xml (added)
+++ sling/trunk/bundles/auth/selector/pom.xml Fri Aug 20 09:22:42 2010
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>sling</artifactId>
+ <version>9</version>
+ <relativePath>../../../parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.apache.sling.auth.selector</artifactId>
+ <packaging>bundle</packaging>
+ <version>0.9.0-SNAPSHOT</version>
+
+ <name>Apache Sling Authentication Selector</name>
+ <description>
+ Bundle implementing a Sling Authentication Handler which
+ allows for choosing which actual authentication handler
+ is to be used delegating the actual credential handling
+ to concrete handlers. The selector handler only presents
+ HTML forms to provide credential data such as username
+ and password for the Formbased Authentication Handler
+ or an OpenID identifier for the OpenID Authentication
+ Handler.
+ </description>
+
+ <scm>
+
<connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/auth/selector</connection>
+
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/auth/selector</developerConnection>
+
<url>http://svn.apache.org/viewvc/sling/trunk/bundles/auth/selector</url>
+ </scm>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-DocURL>
+
http://sling.apache.org/site/openid-authenticationhandler.html
+ </Bundle-DocURL>
+ <Private-Package>
+ org.apache.sling.auth.selector.*
+ </Private-Package>
+ <Embed-Dependency>
+
org.apache.sling.commons.osgi;inline="org/apache/sling/commons/osgi/OsgiUtil.*",
+ </Embed-Dependency>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <excludePackageNames>
+ org.apache.sling.auth.selector
+ </excludePackageNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.api</artifactId>
+ <version>2.0.9-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.auth.core</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.auth.form</artifactId>
+ <version>0.9-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.auth.openid</artifactId>
+ <version>0.9.1-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.commons.osgi</artifactId>
+ <version>2.0.2-incubator</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.scr.annotations</artifactId>
+ <version>1.3.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange: sling/trunk/bundles/auth/selector/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added:
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorAuthenticationHandler.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorAuthenticationHandler.java?rev=987426&view=auto
==============================================================================
---
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorAuthenticationHandler.java
(added)
+++
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorAuthenticationHandler.java
Fri Aug 20 09:22:42 2010
@@ -0,0 +1,177 @@
+/*
+ * 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.
+ */
+package org.apache.sling.auth.selector;
+
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Modified;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.auth.Authenticator;
+import org.apache.sling.auth.core.spi.AbstractAuthenticationHandler;
+import org.apache.sling.auth.core.spi.AuthenticationInfo;
+import org.apache.sling.auth.openid.OpenIDConstants;
+import org.apache.sling.commons.osgi.OsgiUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The <code>SelectorAuthenticationHandler</code> is a pseudo authentication
+ * handler which only implements the
+ * {...@link #requestCredentials(HttpServletRequest, HttpServletResponse)}
method
+ * to cause an input form to be rendered for the client to be able to provide
+ * credentials.
+ * <p>
+ * The default form provided by this handler allows the client to choose from
+ * Form Based and OpenID authentication.
+ */
+...@component(label = "%auth.selector.name", description =
"%auth.selector.description", name =
"org.apache.sling.auth.selector.SelectorAuthenticationHandler")
+...@properties( {
+ @Property(name = "service.description", value = "Apache Sling Selector
Form Handler"),
+ @Property(name = "service.vendor", value = "The Apache Software
Foundation"),
+ @Property(name =
org.apache.sling.auth.core.spi.AuthenticationHandler.PATH_PROPERTY, value =
"/"),
+ @Property(name = "service.ranking", intValue = 5000, propertyPrivate =
false) })
+...@service
+public class SelectorAuthenticationHandler extends
+ AbstractAuthenticationHandler {
+
+ /**
+ * The name of the request parameter indicating to the login form why the
+ * form is being rendered. If this parameter is not set the form is called
+ * for the first time and the implied reason is that the authenticator just
+ * requests credentials. Otherwise the parameter is set to a
+ * {...@link FormReason} value.
+ */
+ static final String PAR_J_REASON = "j_reason";
+
+ /**
+ * Request parameter indicating which authentication type was selected by
+ * the user. This is used to present the appropriate form if login fails.
+ */
+ static final String PAR_SELECTED_AUTH_TYPE = "selectedAuthType";
+
+ /**
+ * The name of the parameter providing the login form URL.
+ */
+ @Property(value = SelectorFormServlet.SERVLET_PATH)
+ private static final String PAR_LOGIN_FORM = "form.login.form";
+
+ /** default log */
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
+ private String loginForm;
+
+ /**
+ * Always returns <code>null</code> because this handler cannot provide
+ * credentials from the request.
+ */
+ public AuthenticationInfo extractCredentials(HttpServletRequest request,
+ HttpServletResponse response) {
+ return null;
+ }
+
+ public boolean requestCredentials(HttpServletRequest request,
+ HttpServletResponse response) throws IOException {
+ String resource = getLoginResource(request, null);
+ if (resource == null) {
+ resource = request.getContextPath() + request.getPathInfo();
+ request.setAttribute(Authenticator.LOGIN_RESOURCE, resource);
+ }
+
+ // prepare the login form redirection target
+ final StringBuilder targetBuilder = new StringBuilder();
+ targetBuilder.append(request.getContextPath());
+ targetBuilder.append(loginForm);
+
+ // append originally requested resource (for redirect after login)
+ char parSep = '?';
+
+ if (resource != null) {
+ targetBuilder.append(parSep).append(Authenticator.LOGIN_RESOURCE);
+ targetBuilder.append("=").append(
+ URLEncoder.encode(resource, "UTF-8"));
+ parSep = '&';
+ }
+
+ // append indication of previous login failure
+ if (request.getAttribute(PAR_J_REASON) != null) {
+ final Object jReason = request.getAttribute(PAR_J_REASON);
+ @SuppressWarnings("unchecked")
+ final String reason = (jReason instanceof Enum)
+ ? ((Enum) jReason).name()
+ : jReason.toString();
+ targetBuilder.append(parSep).append(PAR_J_REASON);
+ targetBuilder.append("=").append(URLEncoder.encode(reason,
"UTF-8"));
+ parSep = '&';
+ } else if (request.getAttribute(OpenIDConstants.OPENID_FAILURE_REASON)
!= null) {
+ final Object jReason =
request.getAttribute(OpenIDConstants.OPENID_FAILURE_REASON);
+ @SuppressWarnings("unchecked")
+ final String reason = (jReason instanceof Enum)
+ ? ((Enum) jReason).name()
+ : jReason.toString();
+ targetBuilder.append(parSep).append(PAR_J_REASON);
+ targetBuilder.append("=").append(URLEncoder.encode(reason,
"UTF-8"));
+ parSep = '&';
+ }
+
+ // append selected authentication type of previous request
+ if (request.getParameter(PAR_SELECTED_AUTH_TYPE) != null) {
+ targetBuilder.append(parSep).append(PAR_SELECTED_AUTH_TYPE);
+ targetBuilder.append("=").append(
+ request.getParameter(PAR_SELECTED_AUTH_TYPE));
+ parSep = '&';
+ }
+
+ // finally redirect to the login form
+ final String target = targetBuilder.toString();
+ try {
+ response.sendRedirect(target);
+ } catch (IOException e) {
+ log.error("Failed to redirect to the page: " + target, e);
+ }
+
+ return true;
+ }
+
+ /**
+ * Nothing to do, this handler does not manage concrete credentials
+ */
+ public void dropCredentials(HttpServletRequest request,
+ HttpServletResponse response) {
+ }
+
+ // ---------- SCR integration
+
+ @SuppressWarnings("unused")
+ @Activate
+ @Modified
+ private void configure(Map<String, ?> properties) {
+ this.loginForm = OsgiUtil.toString(properties.get(PAR_LOGIN_FORM),
+ SelectorFormServlet.SERVLET_PATH);
+ log.info("Login Form URL {}", loginForm);
+ }
+}
Propchange:
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorAuthenticationHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorAuthenticationHandler.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision Rev Url
Added:
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorFormServlet.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorFormServlet.java?rev=987426&view=auto
==============================================================================
---
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorFormServlet.java
(added)
+++
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorFormServlet.java
Fri Aug 20 09:22:42 2010
@@ -0,0 +1,128 @@
+/*
+ * 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.
+ */
+package org.apache.sling.auth.selector;
+
+import java.io.IOException;
+
+import javax.servlet.Servlet;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.auth.core.spi.AbstractAuthenticationFormServlet;
+import org.apache.sling.auth.form.FormReason;
+import org.apache.sling.auth.openid.OpenIDConstants;
+import org.apache.sling.auth.openid.OpenIDFailure;
+
+/**
+ * The <code>SelectorFormServlet</code> provides the default login form used
for
+ * Form Based or OpenID Authentication.
+ */
+...@component(metatype = false)
+...@properties( {
+ @Property(name = "service.vendor", value = "The Apache Software
Foundation"),
+ @Property(name = "service.description", value = "Default Login Form for
the Authenticator Selector") })
+...@service(value = Servlet.class)
+...@suppresswarnings("serial")
+public class SelectorFormServlet extends AbstractAuthenticationFormServlet {
+
+ /**
+ * The constant is used to provide the service registration path
+ */
+ @Property(name = "sling.servlet.paths")
+ static final String SERVLET_PATH = "/system/sling/selector/login";
+
+ /**
+ * This constant is used to provide the service registration property
+ * indicating to pass requests to this servlet unauthenticated.
+ */
+ @Property(name = "sling.auth.requirements")
+ @SuppressWarnings("unused")
+ private static final String AUTH_REQUIREMENT = "-" + SERVLET_PATH;
+
+ @Override
+ protected String getForm(final HttpServletRequest request)
+ throws IOException {
+ String form = super.getForm(request);
+ form = form.replace("${selectedAuthType}",
getSelectedAuthType(request));
+ return form;
+ }
+
+ private String getSelectedAuthType(final HttpServletRequest request) {
+ String type =
request.getParameter(SelectorAuthenticationHandler.PAR_SELECTED_AUTH_TYPE);
+ if (type == null || type.length() == 0) {
+ return "null";
+ }
+ return "\"" + type + "\"";
+ }
+
+ /**
+ * Returns an informational message according to the value provided in the
+ * <code>j_reason</code> request parameter. Supported reasons are invalid
+ * credentials and session timeout.
+ *
+ * @param request The request providing the parameter
+ * @return The "translated" reason to render the login form or an empty
+ * string if there is no specific reason
+ */
+ protected String getReason(final HttpServletRequest request) {
+
+ // 1. Check whether there is a reason from the Form Based
Authentication
+ // Handler
+ Object formResObj =
request.getAttribute(SelectorAuthenticationHandler.PAR_J_REASON);
+ if (formResObj instanceof Enum<?>) {
+ return formResObj.toString();
+ }
+
+ final String jReason =
request.getParameter(SelectorAuthenticationHandler.PAR_J_REASON);
+ if (jReason != null) {
+ try {
+ return FormReason.valueOf(jReason).toString();
+ } catch (IllegalArgumentException iae) {
+ // thrown if the reason is not an expected value, assume none
+ }
+
+ try {
+ OpenIDFailure failure = OpenIDFailure.valueOf(jReason);
+
+ // in case of missing repository user association, tell that
+ // the identity is missing
+ if (failure == OpenIDFailure.REPOSITORY) {
+ Object idObject =
request.getParameter(OpenIDConstants.OPENID_IDENTITY);
+ if (idObject instanceof String) {
+ return "Cannot associate Repository User with OpenID
identifier "
+ + idObject;
+ }
+ }
+
+ return failure.toString();
+
+ } catch (IllegalArgumentException iae) {
+ // thrown if the reason is not an expected value, assume none
+ }
+
+ // no valid FormReason/OpenIDFailure value, use raw value
+ return jReason;
+ }
+
+ return "";
+ }
+}
Propchange:
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorFormServlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
sling/trunk/bundles/auth/selector/src/main/java/org/apache/sling/auth/selector/SelectorFormServlet.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision Rev Url
Added:
sling/trunk/bundles/auth/selector/src/main/resources/org/apache/sling/auth/selector/login.html
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/auth/selector/src/main/resources/org/apache/sling/auth/selector/login.html?rev=987426&view=auto
==============================================================================
---
sling/trunk/bundles/auth/selector/src/main/resources/org/apache/sling/auth/selector/login.html
(added)
+++
sling/trunk/bundles/auth/selector/src/main/resources/org/apache/sling/auth/selector/login.html
Fri Aug 20 09:22:42 2010
@@ -0,0 +1,192 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!--
+
+ 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.
+
+-->
+<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>Login</title>
+
+ <link rel="stylesheet" type="text/css"
href="${requestContextPath}/sling.css"/>
+<style type="text/css">
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ color: black;
+ background-color: white;
+}
+
+.border {
+ border: 1px solid gray;
+ padding: 10px;
+}
+
+#loginform {
+ padding: 0px;
+ margin: 0px;
+}
+
+.openid_background {
+ background-image: url('http://wiki.openid.net/f/openid-16x16.gif');
+ background-repeat: no-repeat;
+ background-position: center left;
+ padding-left: 18px;
+}
+
+#openid_identifier {
+ width: 378px;
+}
+
+#err {
+ color: red;
+}
+</style>
+
+<script>
+
+ function init() {
+ var selectedAuthType = ${selectedAuthType};
+ if (!selectedAuthType || selectedAuthType == "form") {
+ useForm();
+ } else if (selectedAuthType == "openid") {
+ useOpenId();
+ }
+ }
+
+ function selectProvider( /* Button */ provider, /* String */ url ) {
+ provider.form.openid_identifier.value = url;
+ return true;
+ }
+
+ function useOpenId() {
+ document.getElementById("openIdForm").style.display = "block";
+ document.getElementById("formForm").style.display = "none";
+ return false;
+ }
+
+ function useForm() {
+ document.getElementById("openIdForm").style.display = "none";
+ document.getElementById("formForm").style.display = "block";
+ return false;
+ }
+ </script>
+
+</head>
+
+<body onload="init();">
+
+ <div class="title">
+ <div class="logo">
+ <a href="http://sling.apache.org">
+ <img border="0" src="${requestContextPath}/sling-logo.png"/>
+ </a>
+ </div>
+ </div>
+
+ <div class="menu">
+ </div>
+
+<div class="main">
+ <div class="border">
+
+ <p>
+ If you don't have an account, please <a
href="${requestContextPath}/signup.html">sign up</a>.
+ </p>
+
+ <div id="err">
+ <p>${j_reason}</p>
+ </div>
+
+ <div id="formForm" style="display: none;">
+ <form id="formForm" method="post"
+ action="${requestContextPath}/j_security_check"
+ enctype="multipart/form-data" accept-charset="UTF-8">
+
+ <input type="hidden" name="_charset_" value="UTF-8" />
+ <input type="hidden" name="resource" value="${resource}" />
+ <input type="hidden" name="selectedAuthType" value="form" />
+
+ <table>
+ <tr>
+ <td><label for="j_username"><u>U</u>sername:</label></td>
+ <td><input id="j_username" name="j_username" type="text"
+ accesskey="u"/></td>
+ </tr>
+ <tr>
+ <td><label for="j_password"><u>P</u>assword:</label></td>
+ <td><input id="j_password" name="j_password" type="password"
+ accesskey="p"/></td>
+ </tr>
+ </table>
+
+ <p class="buttongroup">
+ <a href="#" onclick="alert('Sorry this is not implemented
yet');">Forgot your password?</a>
+ </p>
+
+ <p class="buttongroup">
+ <button id="login" accesskey="l" class="form-button"
type="submit"><u>L</u>ogin</button>
+ <a href="#" onclick="useOpenId();">or sign in with OpenID</a>
+ </p>
+
+ </form>
+ </div>
+
+
+ <!-- OpenID form -->
+
+ <div id="openIdForm" style="display: none;">
+ <form id="openIdForm" method="post"
+ action="${requestContextPath}/j_security_check"
+ enctype="multipart/form-data" accept-charset="UTF-8">
+
+ <input type="hidden" name="_charset_" value="UTF-8" />
+ <input type="hidden" name="resource" value="${resource}" />
+ <input type="hidden" name="selectedAuthType" value="openid" />
+
+ <table>
+ <tr>
+ <td>Provider:</td>
+ <td>
+ <button id="google" accesskey="g" class="form-button"
+ onclick="return selectProvider(this,
'https://www.google.com/accounts/o8/id');"><u>G</u>oogle</button>
+ <button id="yahoo" accesskey="y" class="form-button"
+ onclick="return selectProvider(this,
'https://me.yahoo.com/');"><u>Y</u>ahoo</button>
+ <button id="myopenid" accesskey="m" class="form-button"
+ onclick="return selectProvider(this,
'https://www.myopenid.com/');"><u>M</u>yOpenID</button>
+ </td>
+ </tr>
+ <tr>
+ <td><label for="openid_identifier">OpenID:</label></td>
+ <td><input id="openid_identifier" name="openid_identifier"
class="openid_background"
+ accesskey="i" onchange="changeField(this);" /></td>
+ </tr>
+ </table>
+
+ <p class="buttongroup">
+ <button id="login" accesskey="l" class="form-button"
type="submit"><u>L</u>ogin</button>
+ <a href="#" onclick="useForm();">or go back to the normal login</a>
+ </p>
+
+ </form>
+ </div>
+ </div>
+</div>
+</body>
+</html>
Propchange:
sling/trunk/bundles/auth/selector/src/main/resources/org/apache/sling/auth/selector/login.html
------------------------------------------------------------------------------
svn:eol-style = native