Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.client.all.product/org.eclipse.osee.ide.product2
-rw-r--r--plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/suite/DemoDbInitTest.java28
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/BaseCredentialProvider.java1
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java19
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/InternalClientSessionManager.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/OSGI-INF/server.stats.console.command.xml1
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationManager.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/OseeServerProperties.java21
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/AuthenticationManager.java63
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/console/ServerStatsCommand.java21
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java3
-rw-r--r--plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeCredential.java9
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeSessionGrant.java10
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/AuthenticationDialog.java11
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/panels/AuthenticationComposite.java61
-rw-r--r--plugins/org.eclipse.osee.x.server.p2/package-server-runtime.xml8
17 files changed, 125 insertions, 140 deletions
diff --git a/plugins/org.eclipse.osee.client.all.product/org.eclipse.osee.ide.product b/plugins/org.eclipse.osee.client.all.product/org.eclipse.osee.ide.product
index 929763905aa..94e79ebd5e6 100644
--- a/plugins/org.eclipse.osee.client.all.product/org.eclipse.osee.ide.product
+++ b/plugins/org.eclipse.osee.client.all.product/org.eclipse.osee.ide.product
@@ -9,7 +9,7 @@
<launcherArgs>
<programArgs>--launcher.XXMaxPermSize
256m</programArgs>
- <vmArgs>-Xmx700m -Dosee.default.broker.uri=BROKER_ID -Dosee.application.server=http://localhost:8089 -Dosee.authentication.protocol=demo</vmArgs>
+ <vmArgs>-Xmx700m -Dosee.default.broker.uri=BROKER_ID -Dosee.application.server=http://localhost:8089</vmArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
</launcherArgs>
diff --git a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/suite/DemoDbInitTest.java b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/suite/DemoDbInitTest.java
index 237a78eaa3c..5d5f6f6f269 100644
--- a/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/suite/DemoDbInitTest.java
+++ b/plugins/org.eclipse.osee.client.integration.tests/src/org/eclipse/osee/client/integration/tests/suite/DemoDbInitTest.java
@@ -14,7 +14,6 @@ import static org.junit.Assert.assertTrue;
import java.util.logging.Level;
import org.eclipse.osee.ats.config.demo.config.DemoDbUtil;
import org.eclipse.osee.framework.core.client.ClientSessionManager;
-import org.eclipse.osee.framework.core.client.OseeClientProperties;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
@@ -40,34 +39,19 @@ public class DemoDbInitTest {
assertTrue("Demo Application Server must be running",
ClientSessionManager.getAuthenticationProtocols().contains("demo"));
RenderingUtil.setPopupsAllowed(false);
-
- // This doesn't make sense if the schema hasn't been created
- // try {
- // DemoDbUtil.setDbInitSuccessful(false);
- // } catch (OseeCoreException ex) {
- // if (!ex.getMessage().contains("Schema OSEE not found")) {
- // throw ex;
- // }
- // }
}
@org.junit.Test
public void testDemoDbInit() throws Exception {
System.out.println("\nBegin database initialization...");
- String lastAuthenticationProtocol = OseeClientProperties.getAuthenticationProtocol();
- try {
- SevereLoggingMonitor monitorLog = TestUtil.severeLoggingStart();
- OseeLog.registerLoggerListener(monitorLog);
- OseeClientProperties.setAuthenticationProtocol("trustAll");
- DatabaseInitializationOperation.executeWithoutPrompting("OSEE Demo Database");
+ SevereLoggingMonitor monitorLog = TestUtil.severeLoggingStart();
+ OseeLog.registerLoggerListener(monitorLog);
+ DatabaseInitializationOperation.executeWithoutPrompting("OSEE Demo Database");
- TestUtil.severeLoggingEnd(monitorLog);
- OseeLog.log(DatabaseInitializationOperation.class, Level.INFO, "Completed database initialization");
- wasDbInitSuccessful = true;
- } finally {
- OseeClientProperties.setAuthenticationProtocol(lastAuthenticationProtocol);
- }
+ TestUtil.severeLoggingEnd(monitorLog);
+ OseeLog.log(DatabaseInitializationOperation.class, Level.INFO, "Completed database initialization");
+ wasDbInitSuccessful = true;
if (wasDbInitSuccessful) {
DemoDbUtil.setDbInitSuccessful(true);
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/BaseCredentialProvider.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/BaseCredentialProvider.java
index 84ccb298214..bdd22766dd6 100644
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/BaseCredentialProvider.java
+++ b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/BaseCredentialProvider.java
@@ -30,7 +30,6 @@ public abstract class BaseCredentialProvider implements ICredentialProvider {
credential.setUserName("");
credential.setDomain("");
credential.setPassword("");
- credential.setAuthenticationProtocol("");
String localAddress = HttpServer.getServerAddressForExternalCommunication();
credential.setClientAddress(Strings.isValid(localAddress) ? localAddress : "Unknown",
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java
index ab9cd263e37..15b784189ba 100644
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java
+++ b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/OseeClientProperties.java
@@ -32,7 +32,6 @@ public class OseeClientProperties extends OseeProperties {
private static final String HEADER_TAG = "OSEE-Client-Property-Init";
- private static final String OSEE_AUTHENTICATION_PROTOCOL = "osee.authentication.protocol";
private static final String OSEE_APPLICATION_SERVER = "osee.application.server";
private static final String OSEE_ARBITRATION_SERVER = "osee.arbitration.server";
@@ -170,24 +169,6 @@ public class OseeClientProperties extends OseeProperties {
}
/**
- * Authentication Protocol to use
- *
- * @return client/server authentication protocol.
- */
- public static String getAuthenticationProtocol() {
- return getProperty(OSEE_AUTHENTICATION_PROTOCOL);
- }
-
- /**
- * Authentication Protocol to use
- *
- * @param client/server authentication protocol.
- */
- public static void setAuthenticationProtocol(String protocol) {
- System.setProperty(OSEE_AUTHENTICATION_PROTOCOL, protocol);
- }
-
- /**
* <pre>
* Sets the application server address and port to use. This system property sets the URL used to reference
* the application server. Arbitration is bypassed.
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/InternalClientSessionManager.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/InternalClientSessionManager.java
index 145ffc92ab9..ae65b87ca1d 100644
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/InternalClientSessionManager.java
+++ b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/InternalClientSessionManager.java
@@ -115,7 +115,7 @@ public class InternalClientSessionManager {
oseeSession =
new OseeClientSession(oseeSessionGrant.getSessionId(), clientInfo.getClientMachineName(),
oseeSessionGrant.getUserToken().getUserId(), clientInfo.getClientAddress(), clientInfo.getPort(),
- clientInfo.getVersion(), credential.getAuthenticationProtocol());
+ clientInfo.getVersion(), oseeSessionGrant.getAuthenticationProtocol());
} catch (Exception ex) {
OseeLog.reportStatus(new BaseStatus(STATUS_ID, Level.SEVERE, ex));
OseeExceptions.wrapAndThrow(ex);
@@ -145,7 +145,6 @@ public class InternalClientSessionManager {
credential.setUserName(userName);
credential.setDomain("");
credential.setPassword("");
- credential.setAuthenticationProtocol(OseeClientProperties.getAuthenticationProtocol());
return credential;
}
});
diff --git a/plugins/org.eclipse.osee.framework.core.server/OSGI-INF/server.stats.console.command.xml b/plugins/org.eclipse.osee.framework.core.server/OSGI-INF/server.stats.console.command.xml
index a710603c4df..203e970a8e2 100644
--- a/plugins/org.eclipse.osee.framework.core.server/OSGI-INF/server.stats.console.command.xml
+++ b/plugins/org.eclipse.osee.framework.core.server/OSGI-INF/server.stats.console.command.xml
@@ -7,4 +7,5 @@
<reference bind="setApplicationServerManager" cardinality="1..1" interface="org.eclipse.osee.framework.core.server.IApplicationServerManager" name="IApplicationServerManager" policy="static"/>
<reference bind="setSessionManager" cardinality="1..1" interface="org.eclipse.osee.framework.core.server.ISessionManager" name="ISessionManager" policy="static"/>
<reference bind="setDbInfoRegistry" cardinality="1..1" interface="org.eclipse.osee.framework.database.DatabaseInfoRegistry" name="DatabaseInfoRegistry" policy="static"/>
+ <reference bind="setAuthenticationManager" cardinality="1..1" interface="org.eclipse.osee.framework.core.server.IAuthenticationManager" name="IAuthenticationManager" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationManager.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationManager.java
index 018df5cd54c..2e68cb3b607 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationManager.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/IAuthenticationManager.java
@@ -51,4 +51,6 @@ public interface IAuthenticationManager {
* @return authentication protocols
*/
public String[] getProtocols();
+
+ public String getProtocol();
}
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/OseeServerProperties.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/OseeServerProperties.java
index 0924eacf4b3..d3376da6051 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/OseeServerProperties.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/OseeServerProperties.java
@@ -23,6 +23,8 @@ public class OseeServerProperties {
private static final String OSGI_PORT_PROPERTY = "org.osgi.service.http.port";
private static final String OSEE_VERSION = "osee.version";
+ private static final String OSEE_AUTHENTICATION_PROTOCOL = "osee.authentication.protocol";
+
private static boolean wasBinaryDataChecked = false;
private OseeServerProperties() {
@@ -92,4 +94,23 @@ public class OseeServerProperties {
public static String getOseeConnectionInfoUri() {
return OseeProperties.getOseeConnectionInfoUri();
}
+
+ /**
+ * Authentication Protocol to use
+ *
+ * @return client/server authentication protocol.
+ */
+ public static String getAuthenticationProtocol() {
+ return System.getProperty(OSEE_AUTHENTICATION_PROTOCOL, "");
+ }
+
+ /**
+ * Authentication Protocol to use
+ *
+ * @param client/server authentication protocol.
+ */
+ public static void setAuthenticationProtocol(String protocol) {
+ System.setProperty(OSEE_AUTHENTICATION_PROTOCOL, protocol);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/AuthenticationManager.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/AuthenticationManager.java
index 7890c1b4bbc..91c98446e73 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/AuthenticationManager.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/AuthenticationManager.java
@@ -10,16 +10,17 @@
*******************************************************************************/
package org.eclipse.osee.framework.core.server.internal;
-import java.util.Collections;
-import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.osee.framework.core.data.IUserToken;
import org.eclipse.osee.framework.core.data.OseeCredential;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.exception.OseeAuthenticationException;
import org.eclipse.osee.framework.core.server.IAuthenticationManager;
import org.eclipse.osee.framework.core.server.IAuthenticationProvider;
+import org.eclipse.osee.framework.core.server.OseeServerProperties;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
* @author Roberto E. Escobar
@@ -29,37 +30,32 @@ public class AuthenticationManager implements IAuthenticationManager {
private final Map<String, IAuthenticationProvider> authenticationProviders;
public AuthenticationManager() {
- this.authenticationProviders = Collections.synchronizedMap(new HashMap<String, IAuthenticationProvider>());
+ this.authenticationProviders = new ConcurrentHashMap<String, IAuthenticationProvider>();
}
@Override
public void addAuthenticationProvider(IAuthenticationProvider authenticationProvider) {
- synchronized (authenticationProviders) {
- final String providerId = authenticationProvider.getProtocol();
- if (!authenticationProviders.containsKey(providerId)) {
- authenticationProviders.put(providerId, authenticationProvider);
- }
- }
+ final String providerId = authenticationProvider.getProtocol();
+ authenticationProviders.put(providerId, authenticationProvider);
+ }
+
+ @Override
+ public void removeAuthenticationProvider(IAuthenticationProvider authenticationProvider) {
+ authenticationProviders.remove(authenticationProvider);
}
@Override
public boolean authenticate(OseeCredential credential) throws OseeAuthenticationException {
+ boolean result = false;
if (isSafeUser(credential)) {
- return true;
+ result = true;
} else {
- IAuthenticationProvider provider = authenticationProviders.get(credential.getAuthenticationProtocol());
+ IAuthenticationProvider provider = getAuthenticationProvider();
if (provider != null) {
- return provider.authenticate(credential);
+ result = provider.authenticate(credential);
}
}
- throw new OseeAuthenticationException("Invalid protocol [%s]", credential.getAuthenticationProtocol());
- }
-
- @Override
- public void removeAuthenticationProvider(IAuthenticationProvider authenticationProvider) {
- synchronized (authenticationProviders) {
- authenticationProviders.remove(authenticationProvider);
- }
+ return result;
}
@Override
@@ -70,17 +66,29 @@ public class AuthenticationManager implements IAuthenticationManager {
@Override
public IUserToken asUserToken(OseeCredential credential) throws OseeAuthenticationException {
+ IUserToken toReturn = null;
if (isGuestLogin(credential)) {
- return SystemUser.Guest;
+ toReturn = SystemUser.Guest;
} else if (isBootStrap(credential)) {
- return SystemUser.BootStrap;
+ toReturn = SystemUser.BootStrap;
} else {
- IAuthenticationProvider provider = authenticationProviders.get(credential.getAuthenticationProtocol());
+ IAuthenticationProvider provider = getAuthenticationProvider();
if (provider != null) {
- return provider.asOseeUserId(credential);
+ toReturn = provider.asOseeUserId(credential);
}
}
- throw new OseeAuthenticationException("Invalid protocol [%s]", credential.getAuthenticationProtocol());
+ return toReturn;
+ }
+
+ private IAuthenticationProvider getAuthenticationProvider() throws OseeAuthenticationException {
+ String key = getProtocol();
+ if (Strings.isValid(key)) {
+ IAuthenticationProvider provider = authenticationProviders.get(key);
+ if (provider != null) {
+ return provider;
+ }
+ }
+ throw new OseeAuthenticationException("Invalid authentication protocol [%s]", key);
}
private boolean isGuestLogin(OseeCredential credential) {
@@ -95,4 +103,9 @@ public class AuthenticationManager implements IAuthenticationManager {
return isGuestLogin(credential) || isBootStrap(credential);
}
+ @Override
+ public String getProtocol() {
+ return OseeServerProperties.getAuthenticationProtocol();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/console/ServerStatsCommand.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/console/ServerStatsCommand.java
index 9da636a68cf..af964404872 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/console/ServerStatsCommand.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/console/ServerStatsCommand.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.console.admin.Console;
import org.eclipse.osee.console.admin.ConsoleCommand;
import org.eclipse.osee.console.admin.ConsoleParameters;
import org.eclipse.osee.framework.core.server.IApplicationServerManager;
+import org.eclipse.osee.framework.core.server.IAuthenticationManager;
import org.eclipse.osee.framework.core.server.ISessionManager;
import org.eclipse.osee.framework.core.server.OseeServerProperties;
import org.eclipse.osee.framework.database.DatabaseInfoRegistry;
@@ -35,6 +36,7 @@ public class ServerStatsCommand implements ConsoleCommand {
private IApplicationServerManager appManager;
private ISessionManager sessionManager;
private DatabaseInfoRegistry registry;
+ private IAuthenticationManager authenticationManager;
public void setDbInfoRegistry(DatabaseInfoRegistry registry) {
this.registry = registry;
@@ -44,6 +46,10 @@ public class ServerStatsCommand implements ConsoleCommand {
this.appManager = appManager;
}
+ public void setAuthenticationManager(IAuthenticationManager authenticationManager) {
+ this.authenticationManager = authenticationManager;
+ }
+
public void setSessionManager(ISessionManager sessionManager) {
this.sessionManager = sessionManager;
}
@@ -56,6 +62,10 @@ public class ServerStatsCommand implements ConsoleCommand {
return appManager;
}
+ private IAuthenticationManager getAuthenticationManager() {
+ return authenticationManager;
+ }
+
private ISessionManager getSessionManager() {
return sessionManager;
}
@@ -77,19 +87,22 @@ public class ServerStatsCommand implements ConsoleCommand {
@Override
public Callable<?> createCallable(Console console, ConsoleParameters params) {
- return new ServerStatsCallable(getDbInfoRegistry(), getApplicationServerManager(), getSessionManager(), console);
+ return new ServerStatsCallable(getDbInfoRegistry(), getApplicationServerManager(), getAuthenticationManager(),
+ getSessionManager(), console);
}
private static final class ServerStatsCallable implements Callable<Boolean> {
private final DatabaseInfoRegistry registry;
private final IApplicationServerManager manager;
+ private final IAuthenticationManager authManager;
private final ISessionManager sessionManager;
private final Console console;
- public ServerStatsCallable(DatabaseInfoRegistry registry, IApplicationServerManager manager, ISessionManager sessionManager, Console console) {
+ public ServerStatsCallable(DatabaseInfoRegistry registry, IApplicationServerManager manager, IAuthenticationManager authenticationManager, ISessionManager sessionManager, Console console) {
super();
this.registry = registry;
this.manager = manager;
+ this.authManager = authenticationManager;
this.sessionManager = sessionManager;
this.console = console;
}
@@ -111,6 +124,10 @@ public class ServerStatsCommand implements ConsoleCommand {
console.writeln("Binary Data Path: [%s]", OseeServerProperties.getOseeApplicationServerData(null));
console.writeln();
+ console.writeln("Authentication Scheme: [%s]", authManager.getProtocol());
+ console.writeln("Supported Authentication Schemes: %s", Arrays.deepToString(authManager.getProtocols()));
+ console.writeln();
+
console.writeln("Supported Versions: %s", Arrays.deepToString(manager.getSupportedVersions()));
console.writeln("Accepting Requests: [%s]", manager.isAcceptingRequests());
console.writeln(Lib.getMemoryInfo());
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java
index 3adeb1b40a2..b8652e1b7a7 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionFactory.java
@@ -72,11 +72,12 @@ public final class SessionFactory implements IOseeTypeFactory {
clientAddress, clientPort, lastInteractionDate, lastInteractionDetails);
}
- public OseeSessionGrant createSessionGrant(Session session, IUserToken userToken) throws OseeCoreException {
+ public OseeSessionGrant createSessionGrant(Session session, IUserToken userToken, String authenticationType) throws OseeCoreException {
Conditions.checkNotNull(session, "Session");
Conditions.checkNotNull(userToken, "IUserToken");
OseeSessionGrant sessionGrant = new OseeSessionGrant(session.getGuid());
+ sessionGrant.setAuthenticationProtocol(authenticationType);
sessionGrant.setCreationRequired(userToken.isCreationRequired());
sessionGrant.setUserToken(userToken);
sessionGrant.setDatabaseInfo(registry.getSelectedDatabaseInfo());
diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java
index 7d370b2eba1..85f17657585 100644
--- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java
+++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/session/SessionManagerImpl.java
@@ -70,7 +70,7 @@ public final class SessionManagerImpl implements ISessionManager {
sessionCache.setIgnoreEnsurePopulateException(false);
}
sessionCache.cache(session);
- sessionGrant = sessionFactory.createSessionGrant(session, userToken);
+ sessionGrant = sessionFactory.createSessionGrant(session, userToken, authenticationManager.getProtocol());
}
return sessionGrant;
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeCredential.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeCredential.java
index 87b027d5957..750b81ba06d 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeCredential.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeCredential.java
@@ -21,7 +21,6 @@ public class OseeCredential extends OseeClientInfo {
private static final String USERNAME = "userName";
private static final String PASSWORD = "password";
private static final String DOMAIN = "domain";
- private static final String AUTHENTICATION_PROTOCOL = "authenticationProtocol";
public OseeCredential() {
super();
@@ -51,14 +50,6 @@ public class OseeCredential extends OseeClientInfo {
return getString(DOMAIN);
}
- public String getAuthenticationProtocol() {
- return getString(AUTHENTICATION_PROTOCOL);
- }
-
- public void setAuthenticationProtocol(String protocol) {
- this.backingData.put(AUTHENTICATION_PROTOCOL, protocol);
- }
-
/**
* Create new instance from XML input
*
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeSessionGrant.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeSessionGrant.java
index 7aedfce69dd..baf8552c2e6 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeSessionGrant.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/OseeSessionGrant.java
@@ -39,6 +39,7 @@ public class OseeSessionGrant extends BaseExchangeData {
private static final String OSEE_IS_USER_ACTIVE = "isOseeUserActive";
private static final String OSEE_APPLICATION_SERVER_DATA_PATH = "oseeApplicationServerDataPath";
private static final String OSEE_CLIENT_BUILD_DESIGNATION = "oseeClientBuildDesignation";
+ private static final String AUTHENTICATION_PROTOCOL = "oseeAuthenticationProtocol";
private IDatabaseInfo grantedDatabaseInfo;
@@ -113,6 +114,14 @@ public class OseeSessionGrant extends BaseExchangeData {
this.backingData.put(OSEE_CLIENT_BUILD_DESIGNATION, designation);
}
+ public String getAuthenticationProtocol() {
+ return getString(AUTHENTICATION_PROTOCOL);
+ }
+
+ public void setAuthenticationProtocol(String protocol) {
+ this.backingData.put(AUTHENTICATION_PROTOCOL, protocol);
+ }
+
public static OseeSessionGrant fromXml(InputStream inputStream) throws OseeCoreException {
OseeSessionGrant session = new OseeSessionGrant();
session.loadfromXml(inputStream);
@@ -169,4 +178,5 @@ public class OseeSessionGrant extends BaseExchangeData {
}
}
+
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/AuthenticationDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/AuthenticationDialog.java
index 01b6ed731cf..d5b02a8f547 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/AuthenticationDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/dialogs/AuthenticationDialog.java
@@ -108,10 +108,6 @@ public class AuthenticationDialog extends OseeMessageDialog {
authenticationComposite.setGuestLogin(isGuestLogin);
}
- private void setProtocol(String protocol) {
- authenticationComposite.setProtocol(protocol);
- }
-
private String getUserName() {
return authenticationComposite.getUserName();
}
@@ -120,10 +116,6 @@ public class AuthenticationDialog extends OseeMessageDialog {
return authenticationComposite.getDomain();
}
- private String getProtocol() {
- return authenticationComposite.getProtocol();
- }
-
private boolean isStorageAllowed() {
return authenticationComposite.isStorageAllowed();
}
@@ -165,7 +157,6 @@ public class AuthenticationDialog extends OseeMessageDialog {
String user = "";
String domain = "";
String message = "";
- String protocol = "";
boolean isStorageAllowed = false;
boolean isGuestLogin = false;
boolean shutdown = false;
@@ -177,14 +168,12 @@ public class AuthenticationDialog extends OseeMessageDialog {
dialog.setUserName(user);
dialog.setPassword("");
dialog.setDomain(domain);
- dialog.setProtocol(protocol);
dialog.setStorageAllowed(isStorageAllowed);
dialog.setGuestLogin(isGuestLogin);
}
int result = dialog.open();
user = dialog.getUserName();
- protocol = dialog.getProtocol();
domain = dialog.getDomain();
isStorageAllowed = dialog.isStorageAllowed();
isGuestLogin = dialog.isGuestLogin();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/panels/AuthenticationComposite.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/panels/AuthenticationComposite.java
index fdeb2bb3980..22ba1458927 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/panels/AuthenticationComposite.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/panels/AuthenticationComposite.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.framework.ui.skynet.panels;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import org.eclipse.osee.framework.core.client.BaseCredentialProvider;
@@ -56,7 +55,6 @@ public class AuthenticationComposite extends Composite {
UserId("Enter user name"),
Password(true, "Enter a valid password"),
Domain("Enter a valid domain [sw, nw, etc...]"),
- Protocol("Select authentication protocol"),
Remember_My_Password(WARNING_MESSAGE);
boolean isHidden;
@@ -207,33 +205,25 @@ public class AuthenticationComposite extends Composite {
int style = SWT.BORDER | SWT.SINGLE;
Control control = null;
- if (labelEnum.equals(LabelEnum.Protocol)) {
- Combo combo = new Combo(composite, style);
- control = combo;
- List<String> protocols = ClientSessionManager.getAuthenticationProtocols();
- combo.setItems(protocols.toArray(new String[protocols.size()]));
- dataMap.put(labelEnum, combo.getText());
- } else {
- Text field = new Text(composite, (labelEnum.isHidden() ? style |= SWT.PASSWORD : style));
- field.setData(LABEL_KEY, labelEnum);
- control = field;
- dataMap.put(labelEnum, field.getText());
- field.addModifyListener(new ModifyListener() {
-
- @Override
- public void modifyText(ModifyEvent e) {
- Object object = e.getSource();
- if (object instanceof Text) {
- Text field = (Text) object;
- LabelEnum labelKey = (LabelEnum) field.getData(LABEL_KEY);
-
- dataMap.put(labelKey, field.getText());
- updateFieldStatus(labelKey, field);
- updateDefaultButtonStatus();
- }
+ Text field = new Text(composite, (labelEnum.isHidden() ? style |= SWT.PASSWORD : style));
+ field.setData(LABEL_KEY, labelEnum);
+ control = field;
+ dataMap.put(labelEnum, field.getText());
+ field.addModifyListener(new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ Object object = e.getSource();
+ if (object instanceof Text) {
+ Text field = (Text) object;
+ LabelEnum labelKey = (LabelEnum) field.getData(LABEL_KEY);
+
+ dataMap.put(labelKey, field.getText());
+ updateFieldStatus(labelKey, field);
+ updateDefaultButtonStatus();
}
- });
- }
+ }
+ });
control.setToolTipText(labelEnum.getToolTipText());
control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
@@ -275,7 +265,6 @@ public class AuthenticationComposite extends Composite {
credential.setUserName(dataMap.get(LabelEnum.UserId));
credential.setPassword(dataMap.get(LabelEnum.Password));
credential.setDomain(dataMap.get(LabelEnum.Domain));
- credential.setAuthenticationProtocol(dataMap.get(LabelEnum.Protocol));
return credential;
}
});
@@ -335,10 +324,6 @@ public class AuthenticationComposite extends Composite {
setAndStoreField(LabelEnum.Remember_My_Password, Boolean.toString(isStorageAllowed));
}
- public void setProtocol(String protocol) {
- setAndStoreField(LabelEnum.Protocol, protocol);
- }
-
private void setAndStoreField(LabelEnum fieldKey, String value) {
if (fieldKey.equals(LabelEnum.Remember_My_Password)) {
if (isWidgetAccessible(memoButton)) {
@@ -391,24 +376,16 @@ public class AuthenticationComposite extends Composite {
return value != null ? Boolean.parseBoolean(value) : false;
}
- public String getProtocol() {
- return dataMap.get(LabelEnum.Protocol);
- }
-
public boolean isValid() {
return allValid;
}
private void updateFieldStatus(LabelEnum labelKey, Widget field) {
switch (labelKey) {
- case Protocol:
- String temp = ((Combo) field).getText();
- statusMap.get(labelKey).setVisible(!Strings.isValid(temp));
- break;
case Remember_My_Password:
break;
default:
- temp = ((Text) field).getText();
+ String temp = ((Text) field).getText();
statusMap.get(labelKey).setVisible(!Strings.isValid(temp));
break;
}
diff --git a/plugins/org.eclipse.osee.x.server.p2/package-server-runtime.xml b/plugins/org.eclipse.osee.x.server.p2/package-server-runtime.xml
index 27d34d94893..98b6308b423 100644
--- a/plugins/org.eclipse.osee.x.server.p2/package-server-runtime.xml
+++ b/plugins/org.eclipse.osee.x.server.p2/package-server-runtime.xml
@@ -58,15 +58,15 @@
<!-- LAUNCH CONFIGS -->
<!-- *************************************************************** -->
<target name="generateTemplate">
- <createLaunch filepath="${server-path}/runExample.sh" connection.id="[id from connection file]" serverport="8089" executable="false" launcher="${equinox-launcher-jar}" extraVMArgs="-Dosee.connection.info.uri=[custom connection file path] \${line.separator}-Dosee.application.server.data=[binary data path]" />
+ <createLaunch filepath="${server-path}/runExample.sh" connection.id="[id from connection file]" serverport="8089" executable="false" launcher="${equinox-launcher-jar}" extraVMArgs="-Dosee.connection.info.uri=[custom connection file path] \${line.separator}-Dosee.application.server.data=[binary data path] \${line.separator}-Dosee.authentication.protocol=[trustAll,demo]" />
</target>
<target name="generateH2Launch">
- <createLaunch filepath="${server-path}/runH2.sh" connection.id="h2" serverport="8089" launcher="${equinox-launcher-jar}" extraVMArgs="-Dosee.db.embedded.server=0.0.0.0:8088" />
+ <createLaunch filepath="${server-path}/runH2.sh" connection.id="h2" serverport="8089" launcher="${equinox-launcher-jar}" extraVMArgs="-Dosee.authentication.protocol=trustAll \${line.separator}-Dosee.db.embedded.server=0.0.0.0:8088" />
</target>
<target name="generateDemoLaunch">
- <createLaunch filepath="${server-path}/runDemo.sh" connection.id="osee.demo.h2" serverport="8089" launcher="${equinox-launcher-jar}" extraVMArgs="-Dosee.db.embedded.server=0.0.0.0:8088 \${line.separator}-Dosee.connection.info.uri=&quot;demo/osee.demo.db.connection.xml&quot; \${line.separator}-Dosee.application.server.data=&quot;demo/binary_data&quot;" />
+ <createLaunch filepath="${server-path}/runDemo.sh" connection.id="osee.demo.h2" serverport="8089" launcher="${equinox-launcher-jar}" extraVMArgs="-Dosee.authentication.protocol=demo \${line.separator}-Dosee.db.embedded.server=0.0.0.0:8088 \${line.separator}-Dosee.connection.info.uri=&quot;demo/osee.demo.db.connection.xml&quot; \${line.separator}-Dosee.application.server.data=&quot;demo/binary_data&quot;" />
<copy file="${server-path}/runDemo.sh" tofile="${server-path}/runDemo.bat" overwrite="true" />
<replaceregexp file="${server-path}/runDemo.bat" match="\\" replace="^" flags="g" />
@@ -83,7 +83,7 @@
</target>
<target name="generateLocalPostgresLaunch">
- <createLaunch filepath="${server-path}/runPostgresqlLocal.sh" connection.id="postgresqlLocalhost" serverport="8089" launcher="${equinox-launcher-jar}" />
+ <createLaunch filepath="${server-path}/runPostgresqlLocal.sh" connection.id="postgresqlLocalhost" serverport="8089" launcher="${equinox-launcher-jar}" extraVMArgs="-Dosee.authentication.protocol=trustAll"/>
</target>
<target name="generateLaunchScripts" depends="generateTemplate,generateDemoLaunch,generateH2Launch,generateLocalPostgresLaunch" />

Back to the top