use of javax.security.auth.login.AppConfigurationEntry in project jackrabbit-oak by apache.
the class TokenDefaultLoginModuleTest method getConfiguration.
@Override
protected Configuration getConfiguration() {
return new Configuration() {
@Override
public AppConfigurationEntry[] getAppConfigurationEntry(String s) {
AppConfigurationEntry tokenEntry = new AppConfigurationEntry(TokenLoginModule.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT, Collections.<String, Object>emptyMap());
AppConfigurationEntry defaultEntry = new AppConfigurationEntry(LoginModuleImpl.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, Collections.<String, Object>emptyMap());
return new AppConfigurationEntry[] { tokenEntry, defaultEntry };
}
};
}
use of javax.security.auth.login.AppConfigurationEntry in project jackrabbit by apache.
the class AuthContextProvider method getModuleConfig.
/**
* @return options configured for the LoginModules to use.
*/
public Properties[] getModuleConfig() {
Properties[] props = new Properties[0];
if (isLocal()) {
props = new Properties[] { config.getParameters() };
} else {
AppConfigurationEntry[] entries = getJAASConfig();
if (entries != null) {
List<Properties> tmp = new ArrayList<Properties>(entries.length);
for (AppConfigurationEntry entry : entries) {
Map opt = entry.getOptions();
if (opt != null) {
Properties prop = new Properties();
prop.putAll(opt);
tmp.add(prop);
}
}
props = tmp.toArray(new Properties[tmp.size()]);
}
}
return props;
}
use of javax.security.auth.login.AppConfigurationEntry in project jackrabbit-oak by apache.
the class GuestDefaultLoginModuleTest method getConfiguration.
@Override
protected Configuration getConfiguration() {
return new Configuration() {
@Override
public AppConfigurationEntry[] getAppConfigurationEntry(String s) {
AppConfigurationEntry guestEntry = new AppConfigurationEntry(GuestLoginModule.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.OPTIONAL, Collections.<String, Object>emptyMap());
AppConfigurationEntry defaultEntry = new AppConfigurationEntry(LoginModuleImpl.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, Collections.<String, Object>emptyMap());
return new AppConfigurationEntry[] { guestEntry, defaultEntry };
}
};
}
use of javax.security.auth.login.AppConfigurationEntry in project karaf by apache.
the class JaasCommandSupport method execute.
/**
* Add the command to the command queue.
*/
@Override
public Object execute() throws Exception {
JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);
@SuppressWarnings("unchecked") Queue<JaasCommandSupport> commandQueue = (Queue<JaasCommandSupport>) session.get(JAAS_CMDS);
if (realm != null && entry != null) {
if (commandQueue != null) {
commandQueue.add(this);
}
} else {
System.err.println("No JAAS Realm / Module has been selected");
}
return null;
}
use of javax.security.auth.login.AppConfigurationEntry in project karaf by apache.
the class ListGroupsCommand method execute.
@Override
public Object execute() throws Exception {
JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);
if (realm == null || entry == null) {
System.err.println("No JAAS Realm / Module has been selected.");
return null;
}
BackingEngine engine = getBackingEngine(entry);
if (engine == null) {
System.err.println("Can't get the list of users (no backing engine service registered)");
return null;
}
return doExecute(engine);
}
Aggregations