Get our own simple cred
JmsCred jc = new JmsCred();
if (subject == null && info != null)
{
// Credentials specifyed on connection request
jc.name = ((JmsConnectionRequestInfo) info).getUserName();
jc.pwd = ((JmsConnectionRequestInfo) info).getPassword();
}
else if (subject != null)
{
// Credentials from appserver
PasswordCredential pwdc = GetCredentialAction.getCredential(subject, mcf);
if (pwdc == null)
{
// No hit - we do need creds
throw new SecurityException("No Password credentials found");
}
jc.name = pwdc.getUserName();
jc.pwd = new String(pwdc.getPassword());
}
else
{
throw new SecurityException("No Subject or ConnectionRequestInfo set, could not get credentials");
}
return jc;