Picketlink SVN: r920 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-26 14:54:27 -0400 (Tue, 26 Apr 2011)
New Revision: 920
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java
Log:
remove generics
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java 2011-04-26 04:37:32 UTC (rev 919)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java 2011-04-26 18:54:27 UTC (rev 920)
@@ -250,7 +250,8 @@
/**
* The shared state map passed into this login modules initalize method.
*/
- protected Map<String, ?> sharedState;
+ @SuppressWarnings("rawtypes")
+ protected Map sharedState;
/**
* Indicates whether password stacking option was configured.
13 years, 8 months
Picketlink SVN: r919 - trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-26 00:37:32 -0400 (Tue, 26 Apr 2011)
New Revision: 919
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/JBWSTokenIssuingLoginModule.java
Log:
use dispatch as BindingProvider
Modified: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/JBWSTokenIssuingLoginModule.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/JBWSTokenIssuingLoginModule.java 2011-04-26 04:36:11 UTC (rev 918)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/JBWSTokenIssuingLoginModule.java 2011-04-26 04:37:32 UTC (rev 919)
@@ -89,7 +89,7 @@
//Get pre-constructed Dispatch from super
Dispatch<Source> dispatch = super.getDispatch();
- BindingProvider bp = (BindingProvider) dispatch.getBinding();
+ BindingProvider bp = (BindingProvider) dispatch;
List<Handler> handlers = bp.getBinding().getHandlerChain();
String handlerStr = (String) options.get("handlerChain");
13 years, 8 months
Picketlink SVN: r918 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-26 00:36:11 -0400 (Tue, 26 Apr 2011)
New Revision: 918
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/STSClient.java
Log:
use ws-policy applies to
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/STSClient.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/STSClient.java 2011-04-26 04:02:11 UTC (rev 917)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/STSClient.java 2011-04-26 04:36:11 UTC (rev 918)
@@ -220,7 +220,7 @@
{
if (StringUtil.isNotNull(wspAppliesTo))
{
- rst.setAppliesTo(WSTrustUtil.createAppliesTo(endpointURI));
+ rst.setAppliesTo(WSTrustUtil.createAppliesTo(wspAppliesTo));
}
else if (endpointURI != null)
rst.setAppliesTo(WSTrustUtil.createAppliesTo(endpointURI));
@@ -471,4 +471,4 @@
if (getDispatch() == null)
throw new RuntimeException("Dispatch has not been set");
}
-}
\ No newline at end of file
+}
13 years, 8 months
Picketlink SVN: r917 - trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-26 00:02:11 -0400 (Tue, 26 Apr 2011)
New Revision: 917
Modified:
trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/JBWSTokenIssuingLoginModule.java
Log:
use correct method
Modified: trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/JBWSTokenIssuingLoginModule.java
===================================================================
--- trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/JBWSTokenIssuingLoginModule.java 2011-04-26 03:59:17 UTC (rev 916)
+++ trust/trunk/jbossws/src/main/java/org/picketlink/trust/jbossws/jaas/JBWSTokenIssuingLoginModule.java 2011-04-26 04:02:11 UTC (rev 917)
@@ -66,7 +66,7 @@
@Override
protected STSClient createWSTrustClient(STSClientConfig config)
{
- return new JBWSTokenClient(config);
+ return new JBWSTokenClient(config,options);
}
public class JBWSTokenClient extends STSClient
13 years, 8 months
Picketlink SVN: r916 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-25 23:59:17 -0400 (Mon, 25 Apr 2011)
New Revision: 916
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/STSClient.java
Log:
use ws-policy applies to
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/STSClient.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/STSClient.java 2011-04-26 03:34:11 UTC (rev 915)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/STSClient.java 2011-04-26 03:59:17 UTC (rev 916)
@@ -36,6 +36,7 @@
import org.picketlink.identity.federation.core.parsers.wst.WSTrustParser;
import org.picketlink.identity.federation.core.saml.v2.util.DocumentUtil;
+import org.picketlink.identity.federation.core.util.StringUtil;
import org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken;
import org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityTokenResponse;
import org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityTokenResponseCollection;
@@ -217,8 +218,12 @@
private RequestSecurityToken setAppliesTo(String endpointURI, RequestSecurityToken rst)
{
- if (endpointURI != null)
+ if (StringUtil.isNotNull(wspAppliesTo))
+ {
rst.setAppliesTo(WSTrustUtil.createAppliesTo(endpointURI));
+ }
+ else if (endpointURI != null)
+ rst.setAppliesTo(WSTrustUtil.createAppliesTo(endpointURI));
return rst;
}
13 years, 8 months
Picketlink SVN: r915 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-25 23:34:11 -0400 (Mon, 25 Apr 2011)
New Revision: 915
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/STSIssuingLoginModule.java
Log:
fallback token type on saml2
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/STSIssuingLoginModule.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/STSIssuingLoginModule.java 2011-04-26 02:53:19 UTC (rev 914)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/STSIssuingLoginModule.java 2011-04-26 03:34:11 UTC (rev 915)
@@ -29,6 +29,7 @@
import javax.security.auth.login.LoginException;
import org.picketlink.identity.federation.core.wstrust.STSClient;
+import org.picketlink.identity.federation.core.wstrust.WSTrustConstants;
import org.picketlink.identity.federation.core.wstrust.WSTrustException;
import org.w3c.dom.Element;
@@ -77,6 +78,8 @@
if (endpointURI == null)
endpointURI = (String) options.get(ENDPOINT_ADDRESS); //base class
tokenType = (String) options.get(TOKEN_TYPE_OPTION);
+ if (tokenType == null)
+ tokenType = WSTrustConstants.SAML2_TOKEN_TYPE;
}
/**
13 years, 8 months
Picketlink SVN: r914 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-25 22:53:19 -0400 (Mon, 25 Apr 2011)
New Revision: 914
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java
Log:
handle the callbacks properly with tracing
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java 2011-04-26 02:00:06 UTC (rev 913)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java 2011-04-26 02:53:19 UTC (rev 914)
@@ -168,6 +168,8 @@
{
private final Logger log = Logger.getLogger(AbstractSTSLoginModule.class);
+ private final boolean trace = log.isTraceEnabled();
+
/**
* Key used in share state map when LMs are stacked.
*/
@@ -466,7 +468,26 @@
{
getCallbackHandler().handle(new Callback[]
{nameCallback, passwordCallback});
- builder.username(nameCallback.getName()).password(new String(passwordCallback.getPassword()));
+ String userNameStr = nameCallback.getName();
+ if (StringUtil.isNotNull(userNameStr))
+ {
+ builder.username(userNameStr);
+ }
+ else
+ {
+ if (trace)
+ log.trace("UserName from callback is null");
+ }
+ char[] passChars = passwordCallback.getPassword();
+ if (passChars != null)
+ {
+ builder.password(new String(passChars));
+ }
+ else
+ {
+ if (trace)
+ log.trace("Password from callback is null");
+ }
}
catch (final IOException e)
{
13 years, 8 months
Picketlink SVN: r913 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-25 22:00:06 -0400 (Mon, 25 Apr 2011)
New Revision: 913
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/STSIssuingLoginModule.java
Log:
fall back on base class
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/STSIssuingLoginModule.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/STSIssuingLoginModule.java 2011-04-25 11:14:14 UTC (rev 912)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/STSIssuingLoginModule.java 2011-04-26 02:00:06 UTC (rev 913)
@@ -59,30 +59,34 @@
*/
public class STSIssuingLoginModule extends AbstractSTSLoginModule
{
- public static final String ENDPOINT_OPTION = "endpointURI";
- public static final String TOKEN_TYPE_OPTION = "tokenType";
+ public static final String ENDPOINT_OPTION = "endpointURI";
- private String endpointURI;
- private String tokenType;
+ public static final String TOKEN_TYPE_OPTION = "tokenType";
- @Override
- public void initialize(final Subject subject, final CallbackHandler callbackHandler, final Map<String, ?> sharedState, final Map<String, ?> options)
- {
- super.initialize(subject, callbackHandler, sharedState, options);
-
- endpointURI = (String) options.get(ENDPOINT_OPTION);
- tokenType = (String) options.get(TOKEN_TYPE_OPTION);
- }
+ private String endpointURI;
- /**
- * This method will issue a token for the configured user.
- *
- * @return Element The issued element.
- * @throws LoginException If an error occurs while trying to perform the authentication.
- */
- public Element invokeSTS(final STSClient stsClient) throws WSTrustException
- {
- return stsClient.issueToken(endpointURI, tokenType);
- }
-
-}
+ private String tokenType;
+
+ @Override
+ public void initialize(final Subject subject, final CallbackHandler callbackHandler,
+ final Map<String, ?> sharedState, final Map<String, ?> options)
+ {
+ super.initialize(subject, callbackHandler, sharedState, options);
+
+ endpointURI = (String) options.get(ENDPOINT_OPTION);
+ if (endpointURI == null)
+ endpointURI = (String) options.get(ENDPOINT_ADDRESS); //base class
+ tokenType = (String) options.get(TOKEN_TYPE_OPTION);
+ }
+
+ /**
+ * This method will issue a token for the configured user.
+ *
+ * @return Element The issued element.
+ * @throws LoginException If an error occurs while trying to perform the authentication.
+ */
+ public Element invokeSTS(final STSClient stsClient) throws WSTrustException
+ {
+ return stsClient.issueToken(endpointURI, tokenType);
+ }
+}
\ No newline at end of file
13 years, 8 months
Picketlink SVN: r912 - in idm/trunk: picketlink-idm-core/src/main/java/org/picketlink/idm/impl/configuration/stax and 1 other directories.
by picketlink-commits@lists.jboss.org
Author: bdaw
Date: 2011-04-25 07:14:14 -0400 (Mon, 25 Apr 2011)
New Revision: 912
Modified:
idm/trunk/picketlink-idm-core/pom.xml
idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/configuration/stax/ParserUtil.java
idm/trunk/picketlink-idm-ldap/src/test/java/org/picketlink/idm/impl/configuration/ldap/LDAPConfigTestCase.java
Log:
- remove staxnav snapshot dep. and fix the build
Modified: idm/trunk/picketlink-idm-core/pom.xml
===================================================================
--- idm/trunk/picketlink-idm-core/pom.xml 2011-04-23 06:39:13 UTC (rev 911)
+++ idm/trunk/picketlink-idm-core/pom.xml 2011-04-25 11:14:14 UTC (rev 912)
@@ -62,9 +62,9 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>staxnav</groupId>
- <artifactId>staxnav</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <groupId>org.staxnav</groupId>
+ <artifactId>staxnav.core</artifactId>
+ <version>0.9.0</version>
</dependency>
</dependencies>
Modified: idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/configuration/stax/ParserUtil.java
===================================================================
--- idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/configuration/stax/ParserUtil.java 2011-04-23 06:39:13 UTC (rev 911)
+++ idm/trunk/picketlink-idm-core/src/main/java/org/picketlink/idm/impl/configuration/stax/ParserUtil.java 2011-04-25 11:14:14 UTC (rev 912)
@@ -58,12 +58,11 @@
{
String name = null;
List<String> values = new LinkedList<String>();
+ String tag = fork.next();
- while(fork.hasNext())
+ while(tag != null)
{
- String tag = fork.next();
-
if (tag.equals("name"))
{
name = fork.getContent();
@@ -72,6 +71,8 @@
{
values.add(fork.getContent());
}
+
+ tag = fork.next();
}
if (name != null && name.length() > 0)
@@ -117,9 +118,10 @@
boolean isReadOnly = false;
boolean isUnique = false;
- while(fork.hasNext())
+ String tag = fork.next();
+
+ while(tag != null)
{
- String tag = fork.next();
if (tag.equals("name"))
{
@@ -149,6 +151,9 @@
{
isUnique = Boolean.valueOf(fork.getContent());
}
+
+ tag = fork.next();
+
}
if (name != null && name.length() > 0)
Modified: idm/trunk/picketlink-idm-ldap/src/test/java/org/picketlink/idm/impl/configuration/ldap/LDAPConfigTestCase.java
===================================================================
--- idm/trunk/picketlink-idm-ldap/src/test/java/org/picketlink/idm/impl/configuration/ldap/LDAPConfigTestCase.java 2011-04-23 06:39:13 UTC (rev 911)
+++ idm/trunk/picketlink-idm-ldap/src/test/java/org/picketlink/idm/impl/configuration/ldap/LDAPConfigTestCase.java 2011-04-25 11:14:14 UTC (rev 912)
@@ -36,12 +36,17 @@
@Override
protected void setUp() throws Exception
{
- InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream("portlet-application.xml");
- XMLInputFactory factory = XMLInputFactory.newInstance();
- XMLStreamReader stream = factory.createXMLStreamReader(is);
+// InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream("portlet-application.xml");
+// XMLInputFactory factory = XMLInputFactory.newInstance();
+// XMLStreamReader stream = factory.createXMLStreamReader(is);
+//
+// navigator = new StaxNavigatorImpl<String>(new Naming.Local(), stream);
+ }
+
+ public void testSimple() throws Exception
+ {
//
- navigator = new StaxNavigatorImpl<String>(new Naming.Local(), stream);
}
}
13 years, 8 months
Picketlink SVN: r911 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2011-04-23 02:39:13 -0400 (Sat, 23 Apr 2011)
New Revision: 911
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java
Log:
take care of masked pwd
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java 2011-04-23 06:29:10 UTC (rev 910)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/auth/AbstractSTSLoginModule.java 2011-04-23 06:39:13 UTC (rev 911)
@@ -48,10 +48,12 @@
import org.jboss.security.mapping.MappingContext;
import org.jboss.security.mapping.MappingManager;
import org.jboss.security.mapping.MappingType;
+import org.picketlink.identity.federation.core.constants.PicketLinkFederationConstants;
import org.picketlink.identity.federation.core.exceptions.ParsingException;
import org.picketlink.identity.federation.core.factories.JBossAuthCacheInvalidationFactory;
import org.picketlink.identity.federation.core.factories.JBossAuthCacheInvalidationFactory.TimeCacheExpiry;
import org.picketlink.identity.federation.core.saml.v2.util.AssertionUtil;
+import org.picketlink.identity.federation.core.util.StringUtil;
import org.picketlink.identity.federation.core.wstrust.STSClient;
import org.picketlink.identity.federation.core.wstrust.STSClientConfig;
import org.picketlink.identity.federation.core.wstrust.STSClientConfig.Builder;
@@ -436,6 +438,22 @@
builder.endpointAddress((String) options.get(ENDPOINT_ADDRESS));
builder.portName((String) options.get(PORT_NAME)).serviceName((String) options.get(SERVICE_NAME));
builder.username((String) options.get(USERNAME_KEY)).password((String) options.get(PASSWORD_KEY));
+
+ String passwordString = (String) options.get(PASSWORD_KEY);
+ if (passwordString != null && passwordString.startsWith(PicketLinkFederationConstants.PASS_MASK_PREFIX))
+ {
+ //password is masked
+ String salt = (String) options.get(PicketLinkFederationConstants.SALT);
+ int iterationCount = Integer.parseInt((String) options.get(PicketLinkFederationConstants.ITERATION_COUNT));
+ try
+ {
+ builder.password(StringUtil.decode(passwordString, salt, iterationCount));
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Unable to decode password:" + passwordString);
+ }
+ }
return builder;
}
}
13 years, 8 months