Continuation of changes to remove Axis dependency.
This commit is contained in:
@@ -132,7 +132,7 @@ public final class AuthToken
|
||||
idenTokenProviderElement.setTextContent(m_identityTokenType);
|
||||
idenTokenElement.appendChild(idenTokenProviderElement);
|
||||
Node idenTokenDataElement = tokenDoc.createElement("ident_token_data");
|
||||
idenTokenDataElement.setTextContent(m_identityTokenType);
|
||||
idenTokenDataElement.setTextContent(m_identityToken);
|
||||
idenTokenElement.appendChild(idenTokenDataElement);
|
||||
|
||||
// Secure the token
|
||||
@@ -350,7 +350,7 @@ public final class AuthToken
|
||||
try
|
||||
{
|
||||
// Instantiate secure token object to be utilized in server type operations
|
||||
m_clientSecTokenUtil = new SecureTokenUtil(true);
|
||||
m_clientSecTokenUtil = new SecureTokenUtil(false);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,6 @@ package com.novell.casa.authtoksvc;
|
||||
import java.io.*;
|
||||
|
||||
import org.apache.xml.security.c14n.Canonicalizer;
|
||||
import org.apache.xml.security.utils.Constants;
|
||||
import org.apache.xml.security.signature.XMLSignature;
|
||||
import org.apache.xml.security.transforms.Transforms;
|
||||
import org.apache.xml.security.keys.content.x509.XMLX509IssuerSerial;
|
||||
@@ -100,13 +99,13 @@ public final class SecureTokenUtil
|
||||
// Load our crypto properties
|
||||
Properties cryptoProperties = new Properties();
|
||||
ClassLoader classLoader = SecureTokenUtil.class.getClassLoader();
|
||||
inStream = classLoader.getResourceAsStream("crypto.properties");
|
||||
inStream = classLoader.getResourceAsStream("casa_crypto.properties");
|
||||
cryptoProperties.load(inStream);
|
||||
|
||||
// Get necessary keystore info from the crypto properties
|
||||
String keystoreType = cryptoProperties.getProperty("org.apache.ws.security.crypto.merlin.keystore.type", "jks");
|
||||
String keystoreFile = cryptoProperties.getProperty("org.apache.ws.security.crypto.merlin.file");
|
||||
String keystorePass = cryptoProperties.getProperty("org.apache.ws.security.crypto.merlin.keystore.password");
|
||||
String keystoreType = cryptoProperties.getProperty("com.novell.casa.authtoksvc.crypto.keystore.type", "jks");
|
||||
String keystoreFile = cryptoProperties.getProperty("com.novell.casa.authtoksvc.crypto.file");
|
||||
String keystorePass = cryptoProperties.getProperty("com.novell.casa.authtoksvc.crypto.keystore.password");
|
||||
if (keystoreType == null
|
||||
|| keystoreFile == null
|
||||
|| keystorePass == null)
|
||||
@@ -123,9 +122,9 @@ public final class SecureTokenUtil
|
||||
// Get signing key and cert if in server mode
|
||||
if (serverMode)
|
||||
{
|
||||
String privateKeyAlias = cryptoProperties.getProperty("org.apache.ws.security.crypto.merlin.keystore.alias");
|
||||
String privateKeyPass = cryptoProperties.getProperty("org.apache.ws.security.crypto.merlin.alias.password");
|
||||
String certificateAlias = cryptoProperties.getProperty("org.apache.ws.security.crypto.merlin.keystore.alias");
|
||||
String privateKeyAlias = cryptoProperties.getProperty("com.novell.casa.authtoksvc.crypto.keystore.alias");
|
||||
String privateKeyPass = cryptoProperties.getProperty("com.novell.casa.authtoksvc.crypto.alias.password");
|
||||
String certificateAlias = cryptoProperties.getProperty("com.novell.casa.authtoksvc.crypto.keystore.alias");
|
||||
if (privateKeyAlias == null
|
||||
|| privateKeyPass == null
|
||||
|| certificateAlias == null)
|
||||
@@ -615,8 +614,6 @@ public final class SecureTokenUtil
|
||||
InputStream inStream = null;
|
||||
try
|
||||
{
|
||||
Constants.setSignatureSpecNSprefix("");
|
||||
|
||||
// Get document from our template
|
||||
inStream = new ByteArrayInputStream(m_secureTokenTemplate.getBytes());
|
||||
|
||||
@@ -746,4 +743,10 @@ public final class SecureTokenUtil
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize xml security engine when class loads
|
||||
static
|
||||
{
|
||||
org.apache.xml.security.Init.init();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,10 +97,10 @@ public final class SessionToken
|
||||
soapBodyElement.appendChild(sessionTokenElement);
|
||||
Node realmElement = tokenDoc.createElement("realm");
|
||||
realmElement.setTextContent(m_realm);
|
||||
sessionTokenElement.appendChild(realmElement);
|
||||
Node idenIdElement = tokenDoc.createElement("ident_id");
|
||||
idenIdElement.setTextContent(m_id);
|
||||
realmElement.appendChild(idenIdElement);
|
||||
sessionTokenElement.appendChild(idenIdElement);
|
||||
sessionTokenElement.insertBefore(realmElement, idenIdElement);
|
||||
|
||||
// Secure the token
|
||||
secTokenUtil.secure(tokenDoc, Integer.valueOf(lifetime).intValue());
|
||||
|
||||
Reference in New Issue
Block a user