1 package org
.argeo
.security
.ui
.rap
;
5 import org
.eclipse
.equinox
.security
.auth
.ILoginContext
;
6 import org
.eclipse
.equinox
.security
.auth
.LoginContextFactory
;
7 import org
.osgi
.framework
.BundleActivator
;
8 import org
.osgi
.framework
.BundleContext
;
10 /** Configure Equinox login context from the bundle context. */
11 public class SecureRapActivator
implements BundleActivator
{
13 public final static String ID
= "org.argeo.security.ui.rap";
14 public final static String CONTEXT_SPRING
= "SPRING";
15 public final static String CONTEXT_SPRING_ANONYMOUS
= "SPRING_ANONYMOUS";
16 private static final String JAAS_CONFIG_FILE
= "/META-INF/jaas_default.txt";
18 private BundleContext bundleContext
;
19 private static SecureRapActivator activator
= null;
21 public void start(BundleContext bundleContext
) throws Exception
{
23 this.bundleContext
= bundleContext
;
26 public void stop(BundleContext context
) throws Exception
{
31 public BundleContext
getBundleContext() {
35 public static SecureRapActivator
getActivator() {
39 static ILoginContext
createLoginContext(String contextName
) {
40 URL configUrl
= getActivator().getBundleContext().getBundle()
41 .getEntry(JAAS_CONFIG_FILE
);
42 return LoginContextFactory
.createContext(contextName
, configUrl
);