|
From: <go...@us...> - 2013-03-28 11:44:52
|
Revision: 16173
http://unicore.svn.sourceforge.net/unicore/?rev=16173&view=rev
Author: golbi
Date: 2013-03-28 11:44:42 +0000 (Thu, 28 Mar 2013)
Log Message:
-----------
Implemented password credential
Modified Paths:
--------------
unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/AuthenticationContext.java
unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/IdentityResolver.java
unity/trunk/engine/src/main/java/pl/edu/icm/unity/engine/authz/AuthorizationManagerImpl.java
unity/trunk/engine/src/test/java/pl/edu/icm/unity/engine/DBIntegrationTestBase.java
unity/trunk/pom.xml
unity/trunk/std-extensions/pom.xml
unity/trunk/std-extensions/src/main/java/pl/edu/icm/unity/stdext/credential/PasswordExchange.java
unity/trunk/std-extensions/src/main/java/pl/edu/icm/unity/stdext/credential/PasswordVerificator.java
unity/trunk/web-admin/src/main/java/pl/edu/icm/unity/webadmin/WebAdminEndpointFactory.java
Added Paths:
-----------
unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/AuthenticatedEntity.java
unity/trunk/std-extensions/src/test/java/pl/
unity/trunk/std-extensions/src/test/java/pl/edu/
unity/trunk/std-extensions/src/test/java/pl/edu/icm/
unity/trunk/std-extensions/src/test/java/pl/edu/icm/unity/
unity/trunk/std-extensions/src/test/java/pl/edu/icm/unity/stdext/
unity/trunk/std-extensions/src/test/java/pl/edu/icm/unity/stdext/credential/
unity/trunk/std-extensions/src/test/java/pl/edu/icm/unity/stdext/credential/TestPassword.java
unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/VaadinAuthentication.java
unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/extensions/
unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/extensions/PasswordRetrievalFactory.java
Removed Paths:
-------------
unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/VaadinAuthentication.java
unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/PasswordRetrievalFactory.java
Added: unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/AuthenticatedEntity.java
===================================================================
--- unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/AuthenticatedEntity.java (rev 0)
+++ unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/AuthenticatedEntity.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2013 ICM Uniwersytet Warszawski All rights reserved.
+ * See LICENCE.txt file for licensing information.
+ */
+package pl.edu.icm.unity.server.authn;
+
+/**
+ * Stores information about authenticated entity.
+ * @author K. Benedyczak
+ */
+public class AuthenticatedEntity
+{
+ private long entityId;
+
+ public AuthenticatedEntity(long entityId)
+ {
+ this.entityId = entityId;
+ }
+
+ public long getEntityId()
+ {
+ return entityId;
+ }
+
+ public void setEntityId(long entityId)
+ {
+ this.entityId = entityId;
+ }
+}
Modified: unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/AuthenticationContext.java
===================================================================
--- unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/AuthenticationContext.java 2013-03-27 23:30:31 UTC (rev 16172)
+++ unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/AuthenticationContext.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -16,12 +16,11 @@
{
private static ThreadLocal<AuthenticationContext> threadLocal = new ThreadLocal<AuthenticationContext>();
- private long entityId;
+ private AuthenticatedEntity euthenticatedEntity;
- public AuthenticationContext(long entityId)
+ public AuthenticationContext(AuthenticatedEntity entityId)
{
- super();
- this.entityId = entityId;
+ this.euthenticatedEntity = entityId;
}
public static void setCurrent(AuthenticationContext context)
@@ -37,8 +36,8 @@
return ret;
}
- public long getEntityId()
+ public AuthenticatedEntity getAuthenticatedEntity()
{
- return entityId;
+ return euthenticatedEntity;
}
}
Modified: unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/IdentityResolver.java
===================================================================
--- unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/IdentityResolver.java 2013-03-27 23:30:31 UTC (rev 16172)
+++ unity/trunk/core/src/main/java/pl/edu/icm/unity/server/authn/IdentityResolver.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -13,6 +13,8 @@
public interface IdentityResolver
{
/**
+ * Resolves an identity for performing authentication. It is guaranteed that the returned
+ * entity has not the disabled authentication state.
* @param identity raw identity value
* @param identityTypes what are the types of the identity, in the preference order
* @param credentialName what credential should be provided in the returned object
Modified: unity/trunk/engine/src/main/java/pl/edu/icm/unity/engine/authz/AuthorizationManagerImpl.java
===================================================================
--- unity/trunk/engine/src/main/java/pl/edu/icm/unity/engine/authz/AuthorizationManagerImpl.java 2013-03-27 23:30:31 UTC (rev 16172)
+++ unity/trunk/engine/src/main/java/pl/edu/icm/unity/engine/authz/AuthorizationManagerImpl.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -147,7 +147,7 @@
{
Group group = groupPath == null ? new Group("/") : new Group(groupPath);
AuthenticationContext authnCtx = AuthenticationContext.getCurrent();
- Set<AuthzRole> roles = establishRoles(authnCtx.getEntityId(), group);
+ Set<AuthzRole> roles = establishRoles(authnCtx.getAuthenticatedEntity().getEntityId(), group);
Set<AuthzCapability> capabilities = getRoleCapabilities(roles, selfAccess);
for (AuthzCapability requiredCapability: requiredCapabilities)
@@ -160,7 +160,7 @@
public boolean isSelf(long subject)
{
AuthenticationContext authnCtx = AuthenticationContext.getCurrent();
- return authnCtx.getEntityId() == subject;
+ return authnCtx.getAuthenticatedEntity().getEntityId() == subject;
}
Modified: unity/trunk/engine/src/test/java/pl/edu/icm/unity/engine/DBIntegrationTestBase.java
===================================================================
--- unity/trunk/engine/src/test/java/pl/edu/icm/unity/engine/DBIntegrationTestBase.java 2013-03-27 23:30:31 UTC (rev 16172)
+++ unity/trunk/engine/src/test/java/pl/edu/icm/unity/engine/DBIntegrationTestBase.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -9,6 +9,7 @@
import pl.edu.icm.unity.engine.internal.EngineInitialization;
import pl.edu.icm.unity.exceptions.EngineException;
+import pl.edu.icm.unity.server.authn.AuthenticatedEntity;
import pl.edu.icm.unity.server.authn.AuthenticationContext;
import pl.edu.icm.unity.server.authn.EntityWithCredential;
import pl.edu.icm.unity.stdext.identity.UsernameIdentity;
@@ -36,7 +37,8 @@
{
EntityWithCredential entity = identityResolver.resolveIdentity(user, new String[] {UsernameIdentity.ID},
EngineInitialization.DEFAULT_CREDENTIAL);
- AuthenticationContext virtualAdmin = new AuthenticationContext(entity.getEntityId());
+ AuthenticationContext virtualAdmin = new AuthenticationContext(
+ new AuthenticatedEntity(entity.getEntityId()));
AuthenticationContext.setCurrent(virtualAdmin);
}
}
Modified: unity/trunk/pom.xml
===================================================================
--- unity/trunk/pom.xml 2013-03-27 23:30:31 UTC (rev 16172)
+++ unity/trunk/pom.xml 2013-03-28 11:44:42 UTC (rev 16173)
@@ -156,6 +156,11 @@
<artifactId>vaadin-client-compiled</artifactId>
<version>${vaadin.version}</version>
</dependency>
+ <dependency>
+ <groupId>edu.vt.middleware</groupId>
+ <artifactId>vt-password</artifactId>
+ <version>3.1.1</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: unity/trunk/std-extensions/pom.xml
===================================================================
--- unity/trunk/std-extensions/pom.xml 2013-03-27 23:30:31 UTC (rev 16172)
+++ unity/trunk/std-extensions/pom.xml 2013-03-28 11:44:42 UTC (rev 16173)
@@ -47,5 +47,9 @@
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
+ <dependency>
+ <groupId>edu.vt.middleware</groupId>
+ <artifactId>vt-password</artifactId>
+ </dependency>
</dependencies>
</project>
Modified: unity/trunk/std-extensions/src/main/java/pl/edu/icm/unity/stdext/credential/PasswordExchange.java
===================================================================
--- unity/trunk/std-extensions/src/main/java/pl/edu/icm/unity/stdext/credential/PasswordExchange.java 2013-03-27 23:30:31 UTC (rev 16172)
+++ unity/trunk/std-extensions/src/main/java/pl/edu/icm/unity/stdext/credential/PasswordExchange.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -6,6 +6,7 @@
import pl.edu.icm.unity.exceptions.IllegalCredentialException;
import pl.edu.icm.unity.exceptions.IllegalIdentityValueException;
+import pl.edu.icm.unity.server.authn.AuthenticatedEntity;
import pl.edu.icm.unity.server.authn.CredentialExchange;
/**
@@ -16,6 +17,6 @@
{
public static final String ID = "password exchange";
- public long checkPassword(String username, String password) throws IllegalIdentityValueException,
+ public AuthenticatedEntity checkPassword(String username, String password) throws IllegalIdentityValueException,
IllegalCredentialException;
}
Modified: unity/trunk/std-extensions/src/main/java/pl/edu/icm/unity/stdext/credential/PasswordVerificator.java
===================================================================
--- unity/trunk/std-extensions/src/main/java/pl/edu/icm/unity/stdext/credential/PasswordVerificator.java 2013-03-27 23:30:31 UTC (rev 16172)
+++ unity/trunk/std-extensions/src/main/java/pl/edu/icm/unity/stdext/credential/PasswordVerificator.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -4,46 +4,133 @@
*/
package pl.edu.icm.unity.stdext.credential;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Random;
import org.bouncycastle.crypto.digests.SHA256Digest;
+import org.bouncycastle.util.Arrays;
import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
+import edu.vt.middleware.password.AlphabeticalSequenceRule;
+import edu.vt.middleware.password.CharacterCharacteristicsRule;
+import edu.vt.middleware.password.DigitCharacterRule;
+import edu.vt.middleware.password.LengthRule;
+import edu.vt.middleware.password.LowercaseCharacterRule;
+import edu.vt.middleware.password.NonAlphanumericCharacterRule;
+import edu.vt.middleware.password.NumericalSequenceRule;
+import edu.vt.middleware.password.Password;
+import edu.vt.middleware.password.PasswordData;
+import edu.vt.middleware.password.PasswordValidator;
+import edu.vt.middleware.password.QwertySequenceRule;
+import edu.vt.middleware.password.RepeatCharacterRegexRule;
+import edu.vt.middleware.password.Rule;
+import edu.vt.middleware.password.RuleResult;
+import edu.vt.middleware.password.UppercaseCharacterRule;
+
import pl.edu.icm.unity.Constants;
import pl.edu.icm.unity.exceptions.IllegalCredentialException;
import pl.edu.icm.unity.exceptions.IllegalIdentityValueException;
import pl.edu.icm.unity.exceptions.RuntimeEngineException;
import pl.edu.icm.unity.server.authn.AbstractLocalVerificator;
+import pl.edu.icm.unity.server.authn.AuthenticatedEntity;
+import pl.edu.icm.unity.server.authn.EntityWithCredential;
+import pl.edu.icm.unity.stdext.identity.UsernameIdentity;
import pl.edu.icm.unity.types.authn.LocalCredentialState;
/**
* Ordinary password credential. Highly configurable: it is possible to set minimal length,
* what character classes are required, minimum number of character classes, how many previous passwords
* should be stored and not repeated after change, how often the password must be changed.
- * TODO - currently this is only a stub. No options are implemented.
+ *
* @author K. Benedyczak
*/
public class PasswordVerificator extends AbstractLocalVerificator implements PasswordExchange
{
+ private static final String[] IDENTITY_TYPES = {UsernameIdentity.ID};
+
private Random random = new Random();
-
+ private int minLength;
+ private int historySize;
+ private int minClassesNum;
+ private boolean denySequences;
+ private long maxAge;
+
+
public PasswordVerificator(String name, String description)
{
super(name, description, PasswordExchange.ID);
}
@Override
+ public String getSerializedConfiguration()
+ {
+ ObjectNode root = Constants.MAPPER.createObjectNode();
+ root.put("minLength", minLength);
+ root.put("historySize", historySize);
+ root.put("minClassesNum", minClassesNum);
+ root.put("maxAge", maxAge);
+ root.put("denySequences", denySequences);
+ try
+ {
+ return Constants.MAPPER.writeValueAsString(root);
+ } catch (JsonProcessingException e)
+ {
+ throw new RuntimeEngineException("Can't serialize password credential configuration to JSON", e);
+ }
+ }
+
+ @Override
+ public void setSerializedConfiguration(String json)
+ {
+ JsonNode root;
+ try
+ {
+ root = Constants.MAPPER.readTree(json);
+ } catch (Exception e)
+ {
+ throw new RuntimeEngineException("Can't deserialize password credential configuration " +
+ "from JSON", e);
+ }
+ minLength = root.get("minLength").asInt();
+ historySize = root.get("historySize").asInt();
+ minClassesNum = root.get("minClassesNum").asInt();
+ maxAge = root.get("maxAge").asLong();
+ denySequences = root.get("denySequences").asBoolean();
+ }
+
+
+ @Override
public String prepareCredential(String rawCredential, String currentCredential)
throws IllegalCredentialException
{
+ Deque<PasswordInfo> currentPasswords = parseDbCredential(currentCredential);
+ verifyNewPassword(rawCredential, currentPasswords);
+
String salt = random.nextInt() + "";
byte[] hashed = hash(rawCredential, salt);
-
+
+ PasswordInfo currentPassword = new PasswordInfo(hashed, salt);
+ if (historySize <= currentPasswords.size())
+ currentPasswords.removeLast();
+ currentPasswords.addFirst(currentPassword);
+
ObjectNode root = Constants.MAPPER.createObjectNode();
- root.put("password", hashed);
- root.put("salt", salt);
+ ArrayNode passwords = root.putArray("passwords");
+ for (PasswordInfo pi: currentPasswords)
+ {
+ ObjectNode entry = passwords.addObject();
+ entry.put("hash", pi.getHash());
+ entry.put("salt", pi.getSalt());
+ entry.put("time", pi.getTime().getTime());
+ }
try
{
return Constants.MAPPER.writeValueAsString(root);
@@ -53,27 +140,101 @@
}
}
+ private Deque<PasswordInfo> parseDbCredential(String raw)
+ {
+ if (raw == null || raw.length() == 0)
+ return new LinkedList<PasswordInfo>();
+ JsonNode root;
+ try
+ {
+ root = Constants.MAPPER.readTree(raw);
+
+ JsonNode passwords = root.get("passwords");
+ Deque<PasswordInfo> ret = new LinkedList<PasswordInfo>();
+ for (int i=0; i<passwords.size(); i++)
+ {
+ JsonNode rawPasswd = passwords.get(i);
+ ret.add(new PasswordInfo(rawPasswd.get("hash").binaryValue(),
+ rawPasswd.get("salt").asText(),
+ rawPasswd.get("time").asLong()));
+ }
+ return ret;
+ } catch (Exception e)
+ {
+ throw new RuntimeEngineException("Can't deserialize password credential from JSON", e);
+ }
+
+ }
+
+
@Override
public LocalCredentialState checkCredentialState(String currentCredential)
{
- // TODO Auto-generated method stub
- return null;
+ Deque<PasswordInfo> currentPasswords = parseDbCredential(currentCredential);
+ if (currentPasswords.isEmpty())
+ return LocalCredentialState.notSet;
+ PasswordInfo currentPassword = currentPasswords.getFirst();
+ Date validityEnd = new Date(currentPassword.getTime().getTime() + maxAge);
+ if (new Date().after(validityEnd))
+ return LocalCredentialState.outdated;
+ return LocalCredentialState.correct;
}
@Override
- public String getSerializedConfiguration()
+ public AuthenticatedEntity checkPassword(String username, String password)
+ throws IllegalIdentityValueException, IllegalCredentialException
{
- // TODO Auto-generated method stub
- return "";
+ EntityWithCredential resolved = identityResolver.resolveIdentity(username,
+ IDENTITY_TYPES, credentialName);
+ String dbCredential = resolved.getCredentialValue();
+ Deque<PasswordInfo> credentials = parseDbCredential(dbCredential);
+ if (credentials.isEmpty())
+ throw new IllegalCredentialException("The entity has no password set");
+ PasswordInfo current = credentials.getFirst();
+ byte[] testedHash = hash(password, current.getSalt());
+ if (!Arrays.areEqual(testedHash, current.getHash()))
+ throw new IllegalCredentialException("The password is incorrect");
+ return new AuthenticatedEntity(resolved.getEntityId());
}
- @Override
- public void setSerializedConfiguration(String json)
+ private void verifyNewPassword(String password, Deque<PasswordInfo> currentCredentials)
{
- // TODO Auto-generated method stub
+ PasswordValidator validator = getPasswordValidator();
+ RuleResult result = validator.validate(new PasswordData(new Password(password)));
+ //TODO when i18n is added this should be extended to provide better information.
+ if (!result.isValid())
+ throw new IllegalCredentialException("Password is too weak");
+
+ for (PasswordInfo pi: currentCredentials)
+ {
+ byte[] newHashed = hash(password, pi.getSalt());
+ if (Arrays.areEqual(newHashed, pi.getHash()))
+ throw new IllegalCredentialException("The same password was recently used");
+ }
}
-
+
+ private PasswordValidator getPasswordValidator()
+ {
+ List<Rule> ruleList = new ArrayList<Rule>();
+ ruleList.add(new LengthRule(minLength, 512));
+ CharacterCharacteristicsRule charRule = new CharacterCharacteristicsRule();
+ charRule.getRules().add(new DigitCharacterRule(1));
+ charRule.getRules().add(new NonAlphanumericCharacterRule(1));
+ charRule.getRules().add(new UppercaseCharacterRule(1));
+ charRule.getRules().add(new LowercaseCharacterRule(1));
+ charRule.setNumberOfCharacteristics(minClassesNum);
+ ruleList.add(charRule);
+ if (denySequences)
+ {
+ ruleList.add(new AlphabeticalSequenceRule());
+ ruleList.add(new NumericalSequenceRule(3, true));
+ ruleList.add(new QwertySequenceRule());
+ ruleList.add(new RepeatCharacterRegexRule(4));
+ }
+ return new PasswordValidator(ruleList);
+ }
+
private byte[] hash(String password, String salt)
{
SHA256Digest digest = new SHA256Digest();
@@ -85,11 +246,45 @@
return hashed;
}
- @Override
- public long checkPassword(String username, String password)
- throws IllegalIdentityValueException, IllegalCredentialException
+
+ /**
+ * In DB representation of the credential state is a list of objects as the one described in this class.
+ * @author K. Benedyczak
+ */
+ private static class PasswordInfo
{
- // TODO Auto-generated method stub
- return 0;
+ private byte[] hash;
+ private String salt;
+ private Date time;
+
+ public PasswordInfo(byte[] hash, String salt)
+ {
+ this.hash = hash;
+ this.salt = salt;
+ this.time = new Date();
+ }
+ public PasswordInfo(byte[] hash, String salt, long time)
+ {
+ this.hash = hash;
+ this.salt = salt;
+ this.time = new Date(time);
+ }
+ public byte[] getHash()
+ {
+ return hash;
+ }
+ public String getSalt()
+ {
+ return salt;
+ }
+ public Date getTime()
+ {
+ return time;
+ }
}
}
+
+
+
+
+
Added: unity/trunk/std-extensions/src/test/java/pl/edu/icm/unity/stdext/credential/TestPassword.java
===================================================================
--- unity/trunk/std-extensions/src/test/java/pl/edu/icm/unity/stdext/credential/TestPassword.java (rev 0)
+++ unity/trunk/std-extensions/src/test/java/pl/edu/icm/unity/stdext/credential/TestPassword.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2013 ICM Uniwersytet Warszawski All rights reserved.
+ * See LICENCE.txt file for licensing information.
+ */
+package pl.edu.icm.unity.stdext.credential;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+
+import pl.edu.icm.unity.exceptions.IllegalCredentialException;
+import pl.edu.icm.unity.server.authn.LocalCredentialVerificator;
+import pl.edu.icm.unity.types.authn.LocalCredentialState;
+
+public class TestPassword
+{
+ @Test
+ public void test() throws Exception
+ {
+ PasswordVerificatorFactory f = new PasswordVerificatorFactory();
+ LocalCredentialVerificator verificator = f.newInstance();
+ verificator.setSerializedConfiguration("{" +
+ "\"minLength\": 5," +
+ "\"historySize\": 3," +
+ "\"minClassesNum\": 2," +
+ "\"denySequences\": true," +
+ "\"maxAge\": 100" +
+ "}");
+ String serialized = verificator.getSerializedConfiguration();
+ verificator.setSerializedConfiguration(serialized);
+
+ assertEquals(LocalCredentialState.notSet, verificator.checkCredentialState(null));
+ try
+ {
+ verificator.prepareCredential("q!0?", "");
+ fail("Set too short password");
+ } catch (IllegalCredentialException e) {}
+ try
+ {
+ verificator.prepareCredential("123q!#", "");
+ fail("Set password wth sequence");
+ } catch (IllegalCredentialException e) {}
+ try
+ {
+ verificator.prepareCredential("zqoqso", "");
+ fail("Set password with 1 class");
+ } catch (IllegalCredentialException e) {}
+
+ String c1 = verificator.prepareCredential("1asdz", "");
+ String c2 = verificator.prepareCredential("2asdz", c1);
+ try
+ {
+ verificator.prepareCredential("1asdz", c2);
+ fail("Set password which was used");
+ } catch (IllegalCredentialException e) {}
+ String c3 = verificator.prepareCredential("3asdz", c2);
+ String c4 = verificator.prepareCredential("4asdz", c3);
+ String c5 = verificator.prepareCredential("1asdz", c4);
+
+ assertEquals(LocalCredentialState.correct, verificator.checkCredentialState(c5));
+ Thread.sleep(100);
+ assertEquals(LocalCredentialState.outdated, verificator.checkCredentialState(c5));
+ }
+}
Modified: unity/trunk/web-admin/src/main/java/pl/edu/icm/unity/webadmin/WebAdminEndpointFactory.java
===================================================================
--- unity/trunk/web-admin/src/main/java/pl/edu/icm/unity/webadmin/WebAdminEndpointFactory.java 2013-03-27 23:30:31 UTC (rev 16172)
+++ unity/trunk/web-admin/src/main/java/pl/edu/icm/unity/webadmin/WebAdminEndpointFactory.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -14,8 +14,8 @@
import pl.edu.icm.unity.server.endpoint.EndpointFactory;
import pl.edu.icm.unity.server.endpoint.EndpointInstance;
import pl.edu.icm.unity.types.endpoint.EndpointTypeDescription;
-import pl.edu.icm.unity.webui.VaadinAuthentication;
import pl.edu.icm.unity.webui.VaadinEndpoint;
+import pl.edu.icm.unity.webui.authn.VaadinAuthentication;
/**
* Factory creating endpoints exposing {@link WebAdminUI}.
Deleted: unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/VaadinAuthentication.java
===================================================================
--- unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/VaadinAuthentication.java 2013-03-27 23:30:31 UTC (rev 16172)
+++ unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/VaadinAuthentication.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -1,18 +0,0 @@
-/*
- * Copyright (c) 2013 ICM Uniwersytet Warszawski All rights reserved.
- * See LICENCE.txt file for licensing information.
- */
-package pl.edu.icm.unity.webui;
-
-import pl.edu.icm.unity.server.authn.CredentialRetrieval;
-import pl.edu.icm.unity.server.endpoint.BindingAuthn;
-
-/**
- * Defines a contract which must be implemented by {@link CredentialRetrieval}s in order to be used
- * with the {@link VaadinEndpoint}.
- * @author K. Benedyczak
- */
-public interface VaadinAuthentication extends BindingAuthn
-{
- public static final String NAME = "web-vaadin7";
-}
Deleted: unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/PasswordRetrievalFactory.java
===================================================================
--- unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/PasswordRetrievalFactory.java 2013-03-27 23:30:31 UTC (rev 16172)
+++ unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/PasswordRetrievalFactory.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013 ICM Uniwersytet Warszawski All rights reserved.
- * See LICENCE.txt file for licensing information.
- */
-package pl.edu.icm.unity.webui.authn;
-
-import org.springframework.stereotype.Component;
-
-import pl.edu.icm.unity.server.authn.CredentialExchange;
-import pl.edu.icm.unity.server.authn.CredentialRetrieval;
-import pl.edu.icm.unity.server.authn.CredentialRetrievalFactory;
-import pl.edu.icm.unity.webui.VaadinAuthentication;
-
-/**
- * Produces password retrievals for the Vaadin authn binding
- * @author K. Benedyczak
- */
-@Component
-public class PasswordRetrievalFactory implements CredentialRetrievalFactory
-{
- public static final String NAME = "web-password";
-
- @Override
- public String getName()
- {
- return NAME;
- }
-
- @Override
- public String getDescription()
- {
- return "Allows for retrieving password typed in a web widget";
- }
-
- @Override
- public CredentialRetrieval newInstance()
- {
- //TODO
- return null;
- }
-
- @Override
- public String getSupportedBinding()
- {
- return VaadinAuthentication.NAME;
- }
-
- @Override
- public boolean isCredentialExchangeSupported(CredentialExchange e)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
-}
Copied: unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/VaadinAuthentication.java (from rev 16163, unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/VaadinAuthentication.java)
===================================================================
--- unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/VaadinAuthentication.java (rev 0)
+++ unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/VaadinAuthentication.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2013 ICM Uniwersytet Warszawski All rights reserved.
+ * See LICENCE.txt file for licensing information.
+ */
+package pl.edu.icm.unity.webui.authn;
+
+import pl.edu.icm.unity.server.authn.CredentialRetrieval;
+import pl.edu.icm.unity.server.endpoint.BindingAuthn;
+import pl.edu.icm.unity.webui.VaadinEndpoint;
+
+/**
+ * Defines a contract which must be implemented by {@link CredentialRetrieval}s in order to be used
+ * with the {@link VaadinEndpoint}.
+ * @author K. Benedyczak
+ */
+public interface VaadinAuthentication extends BindingAuthn
+{
+ public static final String NAME = "web-vaadin7";
+}
Copied: unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/extensions/PasswordRetrievalFactory.java (from rev 16163, unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/PasswordRetrievalFactory.java)
===================================================================
--- unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/extensions/PasswordRetrievalFactory.java (rev 0)
+++ unity/trunk/web-common/src/main/java/pl/edu/icm/unity/webui/authn/extensions/PasswordRetrievalFactory.java 2013-03-28 11:44:42 UTC (rev 16173)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2013 ICM Uniwersytet Warszawski All rights reserved.
+ * See LICENCE.txt file for licensing information.
+ */
+package pl.edu.icm.unity.webui.authn.extensions;
+
+import org.springframework.stereotype.Component;
+
+import pl.edu.icm.unity.server.authn.CredentialExchange;
+import pl.edu.icm.unity.server.authn.CredentialRetrieval;
+import pl.edu.icm.unity.server.authn.CredentialRetrievalFactory;
+import pl.edu.icm.unity.webui.authn.VaadinAuthentication;
+
+/**
+ * Produces password retrievals for the Vaadin authn binding
+ * @author K. Benedyczak
+ */
+@Component
+public class PasswordRetrievalFactory implements CredentialRetrievalFactory
+{
+ public static final String NAME = "web-password";
+
+ @Override
+ public String getName()
+ {
+ return NAME;
+ }
+
+ @Override
+ public String getDescription()
+ {
+ return "Allows for retrieving password typed in a web widget";
+ }
+
+ @Override
+ public CredentialRetrieval newInstance()
+ {
+ //TODO
+ return null;
+ }
+
+ @Override
+ public String getSupportedBinding()
+ {
+ return VaadinAuthentication.NAME;
+ }
+
+ @Override
+ public boolean isCredentialExchangeSupported(CredentialExchange e)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|