VoyenceControl: Unable to connect to the API, receive error: Unable to locate a login configuration
search cancel

VoyenceControl: Unable to connect to the API, receive error: Unable to locate a login configuration

book

Article ID: 315691

calendar_today

Updated On:

Products

VMware

Issue/Introduction

Symptoms:




Unable to connect to the API, receive error: Unable to locate a login configuration
ERROR:

Exception in thread "main" java.lang.SecurityException: Unable to locate a login configuration
 at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:97)


Environment

VMware Smart Assurance - NCM

Cause

The program is unable to locate the login configuration file.  This is necessary for JAAS authentication with JBOSS.

Resolution

You have to set the java.security.auth.login.config system property as follows, so the program knows where the login configuration is:

java.security.auth.login.config=./auth.conf

There are three ways to accomplish this:

  • Hardcode the property in the program via System.setProperty():

    System.setProperty("java.security.auth.login.config","./auth.conf");

  • Load a properties file from the program (code below is an example only): 

    FileInputStream propFile = new FileInputStream("system.properties");
    Properties p = new Properties(System.getProperties());
    p.load(propFile);

    System.setProperties(p);
    propFile.close();

     
  • Set a VM parameter:

    -Djava.security.auth.login.config=./auth.conf

Whichever method is used, the path to the auth.conf file must be valid.  In the above examples, the file would exist in the directory of execution.


Additional Information

The contents of the auth.conf file are as follows:

// The default client login module configuration that infects the
// EJB transport layer with the application caller
VoyenceControl {
   com.powerup.common.security.ClientLoginModule requisite;
   // JBoss LoginModule
   org.jboss.security.ClientLoginModule  requisite password-stacking=true restore-login-identity=true;
    
};

other {
  
   // JBoss LoginModule
   org.jboss.security.ClientLoginModule  required restore-login-identity=true;
};