void createLoginConfig(){
  HashMap<String,String> sslConfigOptions=new HashMap<>();
  HashMap<String,String> configOptions=new HashMap<>();
  sslConfigOptions.put(StubLoginModule.ALLOW_LOGIN_PROPERTY,"true");
  sslConfigOptions.put(StubLoginModule.USERS_PROPERTY,DN_USERNAME);
  sslConfigOptions.put(StubLoginModule.GROUPS_PROPERTY,DN_GROUP);
  AppConfigurationEntry sslConfigEntry=new AppConfigurationEntry("org.apache.activemq.security.StubLoginModule",AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,sslConfigOptions);
  configOptions.put(StubLoginModule.ALLOW_LOGIN_PROPERTY,"true");
  configOptions.put(StubLoginModule.USERS_PROPERTY,INSECURE_USERNAME);
  configOptions.put(StubLoginModule.GROUPS_PROPERTY,INSECURE_GROUP);
  AppConfigurationEntry configEntry=new AppConfigurationEntry("org.apache.activemq.security.StubLoginModule",AppConfigurationEntry.LoginModuleControlFlag.REQUIRED,configOptions);
  StubDualJaasConfiguration jaasConfig=new StubDualJaasConfiguration(configEntry,sslConfigEntry);
  Configuration.setConfiguration(jaasConfig);
}

void createLoginConfig ( ) { HashMap < String , String > sslConfigOptions = new HashMap < > ( ) ; HashMap < String , String > configOptions = new HashMap < > ( ) ; sslConfigOptions . put ( StubLoginModule . ALLOW_LOGIN_PROPERTY , "true" ) ; sslConfigOptions . put ( StubLoginModule . USERS_PROPERTY , DN_USERNAME ) ; sslConfigOptions . put ( StubLoginModule . GROUPS_PROPERTY , DN_GROUP ) ; AppConfigurationEntry sslConfigEntry = new AppConfigurationEntry ( "org.apache.activemq.security.StubLoginModule" , AppConfigurationEntry . LoginModuleControlFlag . REQUIRED , sslConfigOptions ) ; configOptions . put ( StubLoginModule . ALLOW_LOGIN_PROPERTY , "true" ) ; configOptions . put ( StubLoginModule . USERS_PROPERTY , INSECURE_USERNAME ) ; configOptions . put ( StubLoginModule . GROUPS_PROPERTY , INSECURE_GROUP ) ; AppConfigurationEntry configEntry = new AppConfigurationEntry ( "org.apache.activemq.security.StubLoginModule" , AppConfigurationEntry . LoginModuleControlFlag . REQUIRED , configOptions ) ; StubDualJaasConfiguration jaasConfig = new StubDualJaasConfiguration ( configEntry , sslConfigEntry ) ; Configuration . setConfiguration ( jaasConfig ) ; }
create a dual login config , for both ssl and non - ssl connections using the stubloginmodule
