Author: anil.saldhana(a)jboss.com
Date: 2012-02-07 16:18:40 -0500 (Tue, 07 Feb 2012)
New Revision: 1377
Modified:
product/branches/Branch_6_plus/picketlink-core/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java
Log:
local validation fixup
Modified:
product/branches/Branch_6_plus/picketlink-core/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java
===================================================================
---
product/branches/Branch_6_plus/picketlink-core/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java 2012-02-06
22:37:11 UTC (rev 1376)
+++
product/branches/Branch_6_plus/picketlink-core/src/main/java/org/picketlink/identity/federation/bindings/jboss/auth/SAML2STSLoginModule.java 2012-02-07
21:18:40 UTC (rev 1377)
@@ -44,6 +44,7 @@
import javax.xml.ws.Dispatch;
import org.apache.log4j.Logger;
+import org.jboss.security.JSSESecurityDomain;
import org.jboss.security.SecurityConstants;
import org.jboss.security.SimplePrincipal;
import org.jboss.security.auth.callback.ObjectCallback;
@@ -527,27 +528,27 @@
//For unit tests
if (localTestingOnly)
return true;
- throw new RuntimeException(ErrorCodes.NOT_IMPLEMENTED_YET);
- /*
+
try
{
Context ctx = new InitialContext();
- JaasSecurityDomain sd = (JaasSecurityDomain)
ctx.lookup(localValidationSecurityDomain);
+ JSSESecurityDomain sd = (JSSESecurityDomain)
ctx.lookup(localValidationSecurityDomain + "/jsse");
KeyStore ts = sd.getTrustStore();
if (ts == null)
{
- throw new LoginException(ErrorCodes.NULL_VALUE + "SAML2STSLoginModule:
null truststore for " + sd.getName());
+ throw new LoginException(ErrorCodes.NULL_VALUE + "SAML2STSLoginModule:
null truststore for " + localValidationSecurityDomain);
}
- String alias = sd.getKeyStoreAlias();
+ String alias = sd.getServerAlias();
if (alias == null)
{
throw new LoginException(ErrorCodes.NULL_VALUE + "SAML2STSLoginModule:
null KeyStoreAlias for "
- + sd.getName() + "; set 'KeyStoreAlias' in '" +
sd.getName() + "' security domain configuration");
+ + localValidationSecurityDomain + "; set 'KeyStoreAlias'
in '" + localValidationSecurityDomain
+ + "' security domain configuration");
}
Certificate cert = ts.getCertificate(alias);
@@ -555,7 +556,7 @@
if (cert == null)
{
throw new LoginException(ErrorCodes.NULL_VALUE + "SAML2STSLoginModule:
no certificate found for alias '"
- + alias + "' in the '" + sd.getName() + "'
security domain");
+ + alias + "' in the '" +
localValidationSecurityDomain + "' security domain");
}
PublicKey publicKey = cert.getPublicKey();
@@ -579,6 +580,6 @@
{
throw new LoginException(e.toString());
}
- return true;*/
+ return true;
}
}
\ No newline at end of file
Show replies by thread