diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractCommonServer.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractCommonServer.java index 50c67a19d50d24a1c36b420890bd690e305ca253..ecd022ecf333c691ba0513ff23808e8f3b9e8519 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractCommonServer.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/AbstractCommonServer.java @@ -24,7 +24,6 @@ import org.apache.commons.lang.StringUtils; import ch.systemsx.cisd.authentication.IAuthenticationService; import ch.systemsx.cisd.authentication.ISessionManager; import ch.systemsx.cisd.authentication.Principal; -import ch.systemsx.cisd.common.exceptions.EnvironmentFailureException; import ch.systemsx.cisd.common.exceptions.UserFailureException; import ch.systemsx.cisd.openbis.generic.server.business.bo.ICommonBusinessObjectFactory; import ch.systemsx.cisd.openbis.generic.server.business.bo.IExternalDataTable; @@ -63,11 +62,6 @@ abstract class AbstractCommonServer<T extends IServer> extends AbstractServer<T> throw UserFailureException.fromTemplate("Following persons already exist: [%s]", StringUtils.join(userIDs, ",")); } - final String applicationToken = authenticationService.authenticateApplication(); - if (applicationToken == null) - { - throw new EnvironmentFailureException("Authentication service cannot be accessed."); - } List<String> unknownUsers = new ArrayList<String>(); final DisplaySettings defaultDisplaySettings = getDefaultDisplaySettings(sessionToken); List<PersonPE> newPersons = new ArrayList<PersonPE>(); @@ -75,8 +69,7 @@ abstract class AbstractCommonServer<T extends IServer> extends AbstractServer<T> { try { - final Principal principal = - authenticationService.getPrincipal(applicationToken, userID); + final Principal principal = authenticationService.getPrincipal(userID); newPersons.add(createPerson(principal, session.tryGetPerson(), defaultDisplaySettings)); } catch (final IllegalArgumentException e) diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java index 6fd861701c2c5319b0c092ee809676d45819073c..ed836d4ebe34973f6f1a03b65afdac26418ac295 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java @@ -445,16 +445,11 @@ public final class CommonServerTest extends AbstractServerTestCase one(personDAO).listByCodes(Arrays.asList(CommonTestUtils.USER_ID)); will(returnValue(new ArrayList<PersonPE>())); - final String applicationToken = "application-token"; - one(authenticationService).authenticateApplication(); - will(returnValue(applicationToken)); - final PersonPE systemPerson = createSystemUser(); one(personDAO).tryFindPersonByUserId(PersonPE.SYSTEM_USER_ID); will(returnValue(systemPerson)); - one(authenticationService).getPrincipal(applicationToken, - CommonTestUtils.USER_ID); + one(authenticationService).getPrincipal(CommonTestUtils.USER_ID); will(throwException(new IllegalArgumentException())); } }); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/AbstractServerTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/AbstractServerTestCase.java index e47675acdc9afd08f8bf273c90029db20e86e1b4..2ce8d421f6fec440cda68150b957143f7202b772 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/AbstractServerTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/AbstractServerTestCase.java @@ -285,16 +285,11 @@ public abstract class AbstractServerTestCase extends AssertJUnit one(personDAO).listByCodes(Arrays.asList(CommonTestUtils.USER_ID)); will(returnValue(new ArrayList<PersonPE>())); - final String applicationToken = "application-token"; - one(authenticationService).authenticateApplication(); - will(returnValue(applicationToken)); - final PersonPE systemPerson = createSystemUser(); one(personDAO).tryFindPersonByUserId(PersonPE.SYSTEM_USER_ID); will(returnValue(systemPerson)); - one(authenticationService).getPrincipal(applicationToken, - CommonTestUtils.USER_ID); + one(authenticationService).getPrincipal(CommonTestUtils.USER_ID); will(returnValue(PRINCIPAL)); final PersonPE person = CommonTestUtils.createPersonFromPrincipal(PRINCIPAL);