username = (username != null ? username : (String)principals.get(BASE_CONTEXT_NAME));
credential = (credential != null ? credential : (String)credentials.get(BASE_CONTEXT_NAME));
if (log.isDebugEnabled())
log.debug("Authentication::setContextParameters() username: " + username);
// Retrieve and populate an instance of the principal object
IPrincipal principalInstance = securityContext.getPrincipalInstance();
if (username != null && !username.equals("")) {
principalInstance.setUID(username);
}
// Retrieve and populate an instance of the credentials object
IOpaqueCredentials credentialsInstance = securityContext.getOpaqueCredentialsInstance();
if (credentialsInstance != null) {
credentialsInstance.setCredentials(credential);