Author: anil.saldhana(a)jboss.com
Date: 2009-10-12 11:21:50 -0400 (Mon, 12 Oct 2009)
New Revision: 844
Added:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/BaseHandlerConfig.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/DefaultSAML2HandlerChainConfig.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2HandlerConfig.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2MapBasedConfig.java
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/DefaultSAML2HandlerConfig.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2Handler.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2HandlerChainConfig.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/HandlerUtil.java
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/filters/SPFilter.java
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/BaseSAML2Handler.java
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/RolesGenerationHandler.java
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/SAML2IssuerTrustHandler.java
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/servlets/IDPServlet.java
Log:
JBID-198: saml2 handler arch
Added:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/BaseHandlerConfig.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/BaseHandlerConfig.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/BaseHandlerConfig.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.identity.federation.core.saml.v2.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerChainConfig;
+
+/**
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Oct 12, 2009
+ */
+public class BaseHandlerConfig
+{
+ protected Map<String, Object> params = new HashMap<String, Object>();
+
+ /**
+ * Does the config contain the key?
+ * @param key
+ * @return
+ */
+ public boolean containsKey(String key)
+ {
+ return params.containsKey(key);
+ }
+
+ /**
+ * @see SAML2HandlerChainConfig#getParameter(String)
+ */
+ public Object getParameter(String parameterName)
+ {
+ return params.get(parameterName);
+ }
+
+
+ public void set(Map<String, Object> options)
+ {
+ this.params.putAll(options);
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/DefaultSAML2HandlerChainConfig.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/DefaultSAML2HandlerChainConfig.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/DefaultSAML2HandlerChainConfig.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.identity.federation.core.saml.v2.impl;
+
+import java.util.Map;
+
+import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerChainConfig;
+
+/**
+ * Default implementation of the handler config
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Oct 10, 2009
+ */
+public class DefaultSAML2HandlerChainConfig extends BaseHandlerConfig
+implements SAML2HandlerChainConfig
+{
+ public DefaultSAML2HandlerChainConfig(Map<String,Object> map)
+ {
+ this.params = map;
+ }
+}
\ No newline at end of file
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/DefaultSAML2HandlerConfig.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/DefaultSAML2HandlerConfig.java 2009-10-11
14:08:59 UTC (rev 843)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/impl/DefaultSAML2HandlerConfig.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -21,30 +21,14 @@
*/
package org.jboss.identity.federation.core.saml.v2.impl;
-import java.util.HashMap;
-import java.util.Map;
+import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerConfig;
-import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerChainConfig;
-
/**
- * Default implementation of the handler config
+ * Default implementation of the {@code SAML2HandlerConfig}
* @author Anil.Saldhana(a)redhat.com
- * @since Oct 10, 2009
+ * @since Oct 12, 2009
*/
-public class DefaultSAML2HandlerConfig implements SAML2HandlerChainConfig
-{
- private Map<String, Object> params = new HashMap<String, Object>();
-
- public DefaultSAML2HandlerConfig(Map<String,Object> map)
- {
- this.params = map;
- }
-
- /**
- * @see SAML2HandlerChainConfig#getParameter(String)
- */
- public Object getParameter(String parameterName)
- {
- return params.get(parameterName);
- }
-}
\ No newline at end of file
+public class DefaultSAML2HandlerConfig extends BaseHandlerConfig
+implements SAML2HandlerConfig
+{
+}
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2Handler.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2Handler.java 2009-10-11
14:08:59 UTC (rev 843)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2Handler.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -21,8 +21,6 @@
*/
package org.jboss.identity.federation.core.saml.v2.interfaces;
-import java.util.Map;
-
import org.jboss.identity.federation.core.exceptions.ProcessingException;
/**
@@ -36,13 +34,13 @@
* Initialize the handler
* @param handlerConfig Handler Config
*/
- void init(SAML2HandlerChainConfig handlerConfig);
+ void initChainConfig(SAML2HandlerChainConfig handlerChainConfig);
/**
* Initialize the handler from configuration
* @param options
*/
- void init(Map<String,Object> options);
+ void initHandlerConfig(SAML2HandlerConfig handlerConfig);
/**
* Generate a SAML Request to be sent to the IDP
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2HandlerChainConfig.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2HandlerChainConfig.java 2009-10-11
14:08:59 UTC (rev 843)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2HandlerChainConfig.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -21,17 +21,12 @@
*/
package org.jboss.identity.federation.core.saml.v2.interfaces;
+
/**
* Configuration passed to the handler chain
* @author Anil.Saldhana(a)redhat.com
* @since Oct 10, 2009
*/
-public interface SAML2HandlerChainConfig
+public interface SAML2HandlerChainConfig extends SAML2MapBasedConfig
{
- /**
- * Get a parameter from the chain config
- * @param parameterName
- * @return
- */
- public Object getParameter(String parameterName);
}
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2HandlerConfig.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2HandlerConfig.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2HandlerConfig.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.identity.federation.core.saml.v2.interfaces;
+
+
+/**
+ * Configuration passed to the handler
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Oct 10, 2009
+ */
+public interface SAML2HandlerConfig extends SAML2MapBasedConfig
+{
+}
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2MapBasedConfig.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2MapBasedConfig.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/interfaces/SAML2MapBasedConfig.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.identity.federation.core.saml.v2.interfaces;
+
+import java.util.Map;
+
+/**
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Oct 12, 2009
+ */
+public interface SAML2MapBasedConfig
+{
+ /**
+ * Does the config contain the key?
+ * @param key
+ * @return
+ */
+ boolean containsKey(String key);
+
+ /**
+ * Get a parameter from the chain config
+ * @param parameterName
+ * @return
+ */
+ public Object getParameter(String parameterName);
+
+ /**
+ * Set the options
+ * @param options
+ */
+ void set(Map<String,Object> options);
+}
\ No newline at end of file
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/HandlerUtil.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/HandlerUtil.java 2009-10-11
14:08:59 UTC (rev 843)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/HandlerUtil.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -31,7 +31,9 @@
import org.jboss.identity.federation.core.exceptions.ConfigurationException;
import org.jboss.identity.federation.core.handler.config.Handler;
import org.jboss.identity.federation.core.handler.config.Handlers;
+import org.jboss.identity.federation.core.saml.v2.impl.DefaultSAML2HandlerConfig;
import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2Handler;
+import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerConfig;
/**
* Deals with SAML2 Handlers
@@ -67,7 +69,10 @@
{
mapOptions.put(kvtype.getKey(), kvtype.getValue());
}
- samlhandler.init(mapOptions);
+ SAML2HandlerConfig handlerConfig = new DefaultSAML2HandlerConfig();
+ handlerConfig.set(mapOptions);
+
+ samlhandler.initHandlerConfig(handlerConfig);
handlerSet.add(samlhandler);
}
Modified:
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/filters/SPFilter.java
===================================================================
---
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/filters/SPFilter.java 2009-10-11
14:08:59 UTC (rev 843)
+++
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/filters/SPFilter.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -74,7 +74,7 @@
import org.jboss.identity.federation.core.saml.v2.holders.DestinationInfoHolder;
import org.jboss.identity.federation.core.saml.v2.holders.IssuerInfoHolder;
import org.jboss.identity.federation.core.saml.v2.impl.DefaultSAML2HandlerChain;
-import org.jboss.identity.federation.core.saml.v2.impl.DefaultSAML2HandlerConfig;
+import org.jboss.identity.federation.core.saml.v2.impl.DefaultSAML2HandlerChainConfig;
import org.jboss.identity.federation.core.saml.v2.impl.DefaultSAML2HandlerRequest;
import org.jboss.identity.federation.core.saml.v2.impl.DefaultSAML2HandlerResponse;
import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2Handler;
@@ -392,12 +392,12 @@
Map<String, Object> configOptions = new HashMap<String, Object>();
configOptions.put(GeneralConstants.CONFIGURATION, spConfiguration);
- SAML2HandlerChainConfig handlerConfig = new
DefaultSAML2HandlerConfig(configOptions);
+ SAML2HandlerChainConfig handlerConfig = new
DefaultSAML2HandlerChainConfig(configOptions);
Set<SAML2Handler> samlHandlers = chain.handlers();
for(SAML2Handler handler: samlHandlers)
{
- handler.init(handlerConfig);
+ handler.initChainConfig(handlerConfig);
}
}
catch(Exception e)
Modified:
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/BaseSAML2Handler.java
===================================================================
---
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/BaseSAML2Handler.java 2009-10-11
14:08:59 UTC (rev 843)
+++
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/BaseSAML2Handler.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -21,15 +21,15 @@
*/
package org.jboss.identity.federation.web.handlers.saml2;
-import java.util.Map;
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.jboss.identity.federation.core.exceptions.ProcessingException;
import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2Handler;
import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerChainConfig;
+import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerConfig;
import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerRequest;
+import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerResponse;
import org.jboss.identity.federation.web.core.HTTPContext;
/**
@@ -39,25 +39,35 @@
*/
public abstract class BaseSAML2Handler implements SAML2Handler
{
- protected Map<String, Object> options;
+ protected SAML2HandlerConfig handlerConfig = null;
+ protected SAML2HandlerChainConfig handlerChainConfig = null;
/**
* Initialize the handler
* @param options
*/
- public void init(Map<String, Object> options)
+ public void initHandlerConfig(SAML2HandlerConfig handlerConfig)
{
- this.options = options;
+ this.handlerConfig = handlerConfig;
}
- public void init(SAML2HandlerChainConfig handlerConfig)
- {
+ public void initChainConfig(SAML2HandlerChainConfig handlerChainConfig)
+ {
+ this.handlerChainConfig = handlerChainConfig;
}
public void reset() throws ProcessingException
{
}
+ /**
+ * @see SAML2Handler#generateSAMLRequest(SAML2HandlerRequest, SAML2HandlerResponse)
+ */
+ public void generateSAMLRequest(SAML2HandlerRequest request, SAML2HandlerResponse
response)
+ throws ProcessingException
+ {
+ }
+
public static HttpServletRequest getHttpRequest(SAML2HandlerRequest request)
{
HTTPContext context = (HTTPContext) request.getContext();
Modified:
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/RolesGenerationHandler.java
===================================================================
---
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/RolesGenerationHandler.java 2009-10-11
14:08:59 UTC (rev 843)
+++
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/RolesGenerationHandler.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -23,12 +23,12 @@
import java.security.Principal;
import java.util.List;
-import java.util.Map;
import javax.servlet.http.HttpSession;
import org.jboss.identity.federation.core.exceptions.ProcessingException;
import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerChainConfig;
+import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerConfig;
import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerRequest;
import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2HandlerResponse;
import org.jboss.identity.federation.saml.v2.protocol.LogoutRequestType;
@@ -43,21 +43,23 @@
*/
public class RolesGenerationHandler extends BaseSAML2Handler
{
+
@SuppressWarnings("unused")
private transient RoleGenerator rg = null;
- public void init(SAML2HandlerChainConfig handlerConfig)
+ public void initChainConfig(SAML2HandlerChainConfig handlerConfig)
{
rg = (RoleGenerator) handlerConfig.getParameter(GeneralConstants.ROLE_GENERATOR);
}
@Override
- public void init(Map<String, Object> options)
+ public void initHandlerConfig(SAML2HandlerConfig handlerConfig)
{
- super.init(options);
- if(options.containsKey(GeneralConstants.ROLE_GENERATOR))
+ super.initHandlerConfig(handlerConfig);
+
+ if(this.handlerConfig.containsKey(GeneralConstants.ROLE_GENERATOR))
{
- String clazzName = (String) options.get(GeneralConstants.ROLE_GENERATOR);
+ String clazzName = (String)
this.handlerConfig.getParameter(GeneralConstants.ROLE_GENERATOR);
ClassLoader tcl = SecurityActions.getContextClassLoader();
try
{
@@ -102,9 +104,4 @@
throws ProcessingException
{
}
-
- public void generateSAMLRequest(SAML2HandlerRequest request, SAML2HandlerResponse
response)
- throws ProcessingException
- {
- }
-}
+}
\ No newline at end of file
Modified:
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java
===================================================================
---
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java 2009-10-11
14:08:59 UTC (rev 843)
+++
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/SAML2AuthenticationHandler.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -359,9 +359,12 @@
return userName;
}
};
+ //Validate the roles
+ IRoleValidator roleValidator =
+ (IRoleValidator)
handlerChainConfig.getParameter(GeneralConstants.ROLE_VALIDATOR);
+ if(roleValidator == null)
+ throw new ProcessingException("Role Validator not provided");
- //Validate the roles
- IRoleValidator roleValidator = (IRoleValidator)
options.get(GeneralConstants.ROLE_VALIDATOR);
boolean validRole = roleValidator.userInRole(principal, roles);
if(!validRole)
{
Modified:
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/SAML2IssuerTrustHandler.java
===================================================================
---
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/SAML2IssuerTrustHandler.java 2009-10-11
14:08:59 UTC (rev 843)
+++
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/handlers/saml2/SAML2IssuerTrustHandler.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -48,12 +48,6 @@
private boolean trace = log.isTraceEnabled();
private IDPTrustHandler idp = new IDPTrustHandler();
private SPTrustHandler sp = new SPTrustHandler();
-
- public void generateSAMLRequest(SAML2HandlerRequest request, SAML2HandlerResponse
response)
- throws ProcessingException
- {
- //Nothing to do here
- }
public void handleRequestType(SAML2HandlerRequest request, SAML2HandlerResponse
response) throws ProcessingException
{
Modified:
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/servlets/IDPServlet.java
===================================================================
---
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/servlets/IDPServlet.java 2009-10-11
14:08:59 UTC (rev 843)
+++
identity-federation/trunk/jboss-identity-web/src/main/java/org/jboss/identity/federation/web/servlets/IDPServlet.java 2009-10-12
15:21:50 UTC (rev 844)
@@ -58,7 +58,7 @@
import org.jboss.identity.federation.core.saml.v2.exceptions.IssuerNotTrustedException;
import org.jboss.identity.federation.core.saml.v2.holders.IssuerInfoHolder;
import org.jboss.identity.federation.core.saml.v2.impl.DefaultSAML2HandlerChain;
-import org.jboss.identity.federation.core.saml.v2.impl.DefaultSAML2HandlerConfig;
+import org.jboss.identity.federation.core.saml.v2.impl.DefaultSAML2HandlerChainConfig;
import org.jboss.identity.federation.core.saml.v2.impl.DefaultSAML2HandlerRequest;
import org.jboss.identity.federation.core.saml.v2.impl.DefaultSAML2HandlerResponse;
import org.jboss.identity.federation.core.saml.v2.interfaces.SAML2Handler;
@@ -155,12 +155,12 @@
Map<String, Object> configOptions = new HashMap<String, Object>();
configOptions.put(GeneralConstants.ROLE_GENERATOR, rg);
- SAML2HandlerChainConfig handlerConfig = new
DefaultSAML2HandlerConfig(configOptions);
+ SAML2HandlerChainConfig handlerConfig = new
DefaultSAML2HandlerChainConfig(configOptions);
Set<SAML2Handler> samlHandlers = chain.handlers();
for(SAML2Handler handler: samlHandlers)
{
- handler.init(handlerConfig);
+ handler.initChainConfig(handlerConfig);
}
}