Author: sguilhen(a)redhat.com
Date: 2009-03-27 09:12:48 -0400 (Fri, 27 Mar 2009)
New Revision: 405
Added:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityActions.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/StandardRequestHandler.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/StandardSTSConfiguration.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/JBossSTSConfig.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/Keystore.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ObjectFactory.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ServiceProvider.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ServiceProviders.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/TokenProvider.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/TokenProviders.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/Truststore.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/package-info.java
identity-federation/trunk/identity-fed-model/src/main/resources/schema/wstrust/v1_3/jboss-sts.xsd
Removed:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossRequestHandler.java
Modified:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossSTS.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/STSConfiguration.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustServiceFactory.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenCollectionType.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenResponseCollectionType.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenResponseType.java
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenType.java
Log:
Added JAXB model for STS configuration. Implemented StandardSTSConfiguration class which
uses the model to provide configuration info.
Deleted:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossRequestHandler.java
===================================================================
---
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossRequestHandler.java 2009-03-26
21:30:27 UTC (rev 404)
+++
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossRequestHandler.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -1,160 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.bindings.jboss.trust;
-
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.identity.federation.api.wstrust.STSConfiguration;
-import org.jboss.identity.federation.api.wstrust.SecurityTokenProvider;
-import org.jboss.identity.federation.api.wstrust.WSTrustException;
-import org.jboss.identity.federation.api.wstrust.WSTrustRequestContext;
-import org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler;
-import org.jboss.identity.federation.api.wstrust.WSTrustUtil;
-import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken;
-import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityTokenResponse;
-import org.jboss.identity.federation.ws.policy.AppliesTo;
-import org.jboss.identity.federation.ws.trust.LifetimeType;
-import org.jboss.identity.federation.ws.trust.RequestedSecurityTokenType;
-
-/**
- * <p>
- * Default implementation of the {@code WSTrustRequestHandler} interface. It creates the
request context containing the
- * original WS-Trust request as well as any information that may be relevant to the token
processing, and delegates the
- * actual token handling processing to the appropriate {@code SecurityTokenProvider}.
- * </p>
- *
- * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
- */
-public class JBossRequestHandler implements WSTrustRequestHandler
-{
-
- private STSConfiguration configuration;
-
- /*
- * (non-Javadoc)
- *
- * @see
org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#initialize(org.jboss.identity.federation.api.wstrust.STSConfiguration)
- */
- public void initialize(STSConfiguration configuration)
- {
- this.configuration = configuration;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#issue(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
- * javax.xml.ws.handler.MessageContext)
- */
- public RequestSecurityTokenResponse issue(RequestSecurityToken request, MessageContext
context)
- throws WSTrustException
- {
- SecurityTokenProvider provider = null;
-
- // first try to obtain the security token provider using the applies-to contents.
- AppliesTo appliesTo = request.getAppliesTo();
- if(appliesTo != null)
- {
- String serviceName = WSTrustUtil.parseAppliesTo(appliesTo);
- if(serviceName != null)
- provider = this.configuration.getProviderForService(serviceName);
- }
- // if applies-to is not available or if no provider was found for the service, use
the token type.
- if(provider == null && request.getTokenType() != null)
- {
- provider =
this.configuration.getProviderForTokenType(request.getTokenType().toString());
- }
- else if(appliesTo == null && request.getTokenType() == null)
- throw new WSTrustException("Either AppliesTo or TokenType must be present
in a security token request");
-
- if(provider != null)
- {
- // create the request context and delegate token generation to the provider.
- WSTrustRequestContext requestContext = new WSTrustRequestContext(request);
- if(request.getLifetime() == null &&
this.configuration.getIssuedTokenTimeout() != 0)
- {
- // if no lifetime has been specified, use the configured timeout value.
- LifetimeType lifetime =
WSTrustUtil.createDefaultLifetime(this.configuration.getIssuedTokenTimeout());
- request.setLifetime(lifetime);
- }
- provider.issueToken(requestContext);
-
- // construct the ws-trust security token response.
- RequestedSecurityTokenType requestedSecurityToken = new
RequestedSecurityTokenType();
- requestedSecurityToken.setAny(requestContext.getSecurityToken());
-
- // TODO: create proof token and encrypt the token if needed
-
- RequestSecurityTokenResponse response = new RequestSecurityTokenResponse();
- if(request.getContext() != null)
- response.setContext(request.getContext());
-
- response.setTokenType(request.getTokenType());
- response.setLifetime(request.getLifetime());
- response.setAppliesTo(appliesTo);
- response.setRequestedSecurityToken(requestedSecurityToken);
- return response;
- }
- else
- throw new WSTrustException("Unable to find a token provider for the token
request");
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#renew(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
- * javax.xml.ws.handler.MessageContext)
- */
- public RequestSecurityTokenResponse renew(RequestSecurityToken request, MessageContext
context)
- throws WSTrustException
- {
- // TODO: implement renew logic.
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#validate(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
- * javax.xml.ws.handler.MessageContext)
- */
- public RequestSecurityTokenResponse validate(RequestSecurityToken request,
MessageContext context)
- throws WSTrustException
- {
- // TODO: implement validate logic.
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#cancel(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
- * javax.xml.ws.handler.MessageContext)
- */
- public RequestSecurityTokenResponse cancel(RequestSecurityToken request,
MessageContext context)
- throws WSTrustException
- {
- // TODO: implement cancel logic.
- throw new UnsupportedOperationException();
- }
-
-}
Modified:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossSTS.java
===================================================================
---
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossSTS.java 2009-03-26
21:30:27 UTC (rev 404)
+++
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/jboss/trust/JBossSTS.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -21,6 +21,8 @@
*/
package org.jboss.identity.federation.bindings.jboss.trust;
+import java.net.URL;
+
import javax.annotation.Resource;
import javax.xml.transform.Source;
import javax.xml.ws.Service;
@@ -157,7 +159,8 @@
*/
protected STSConfiguration getConfiguration()
{
- // TODO: create the configuration instance.
- return null;
+ // get the configuration file and parse it.
+ URL configurationFile =
Thread.currentThread().getContextClassLoader().getResource("jboss-sts.xml");
+ return WSTrustJAXBFactory.getInstance().parseConfiguration(configurationFile);
}
}
Modified:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/STSConfiguration.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/STSConfiguration.java 2009-03-26
21:30:27 UTC (rev 404)
+++
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/STSConfiguration.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -62,6 +62,15 @@
/**
* <p>
+ * Obtains the fully-qualified name of the request handler class.
+ * </p>
+ *
+ * @return a {@code String} representing the request handler FQN.
+ */
+ public String getRequestHandlerClass();
+
+ /**
+ * <p>
* Given the name of a service provider, obtains the type of the token that should be
used when issuing tokens to
* clients of that service.
* </p>
Added:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityActions.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityActions.java
(rev 0)
+++
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/SecurityActions.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.api.wstrust;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+/**
+ *
+ * <p>
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+class SecurityActions
+{
+
+ /**
+ *
+ * @return
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+
+ /**
+ *
+ * @param name
+ * @return
+ * @throws PrivilegedActionException
+ */
+ static Class<?> loadClass(final String name) throws PrivilegedActionException
+ {
+ return AccessController.doPrivileged(new
PrivilegedExceptionAction<Class<?>>()
+ {
+ public Class<?> run() throws PrivilegedActionException
+ {
+ try
+ {
+ return getContextClassLoader().loadClass(name);
+ }
+ catch (Exception e)
+ {
+ throw new PrivilegedActionException(e);
+ }
+ }
+ });
+ }
+
+ /**
+ *
+ * @param className
+ * @return
+ * @throws PrivilegedActionException
+ */
+ static Object instantiateClass(final String className) throws
PrivilegedActionException
+ {
+ return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>()
+ {
+ public Object run() throws Exception
+ {
+ Class<?> objectClass = loadClass(className);
+ return objectClass.newInstance();
+ }
+ });
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/StandardRequestHandler.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/StandardRequestHandler.java
(rev 0)
+++
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/StandardRequestHandler.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.api.wstrust;
+
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.identity.federation.api.wstrust.STSConfiguration;
+import org.jboss.identity.federation.api.wstrust.SecurityTokenProvider;
+import org.jboss.identity.federation.api.wstrust.WSTrustException;
+import org.jboss.identity.federation.api.wstrust.WSTrustRequestContext;
+import org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler;
+import org.jboss.identity.federation.api.wstrust.WSTrustUtil;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken;
+import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityTokenResponse;
+import org.jboss.identity.federation.ws.policy.AppliesTo;
+import org.jboss.identity.federation.ws.trust.LifetimeType;
+import org.jboss.identity.federation.ws.trust.RequestedSecurityTokenType;
+
+/**
+ * <p>
+ * Default implementation of the {@code WSTrustRequestHandler} interface. It creates the
request context containing the
+ * original WS-Trust request as well as any information that may be relevant to the token
processing, and delegates the
+ * actual token handling processing to the appropriate {@code SecurityTokenProvider}.
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class StandardRequestHandler implements WSTrustRequestHandler
+{
+
+ private STSConfiguration configuration;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#initialize(org.jboss.identity.federation.api.wstrust.STSConfiguration)
+ */
+ public void initialize(STSConfiguration configuration)
+ {
+ this.configuration = configuration;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#issue(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
+ * javax.xml.ws.handler.MessageContext)
+ */
+ public RequestSecurityTokenResponse issue(RequestSecurityToken request, MessageContext
context)
+ throws WSTrustException
+ {
+ SecurityTokenProvider provider = null;
+
+ // first try to obtain the security token provider using the applies-to contents.
+ AppliesTo appliesTo = request.getAppliesTo();
+ if(appliesTo != null)
+ {
+ String serviceName = WSTrustUtil.parseAppliesTo(appliesTo);
+ if(serviceName != null)
+ provider = this.configuration.getProviderForService(serviceName);
+ }
+ // if applies-to is not available or if no provider was found for the service, use
the token type.
+ if(provider == null && request.getTokenType() != null)
+ {
+ provider =
this.configuration.getProviderForTokenType(request.getTokenType().toString());
+ }
+ else if(appliesTo == null && request.getTokenType() == null)
+ throw new WSTrustException("Either AppliesTo or TokenType must be present
in a security token request");
+
+ if(provider != null)
+ {
+ // create the request context and delegate token generation to the provider.
+ WSTrustRequestContext requestContext = new WSTrustRequestContext(request);
+ if(request.getLifetime() == null &&
this.configuration.getIssuedTokenTimeout() != 0)
+ {
+ // if no lifetime has been specified, use the configured timeout value.
+ LifetimeType lifetime =
WSTrustUtil.createDefaultLifetime(this.configuration.getIssuedTokenTimeout());
+ request.setLifetime(lifetime);
+ }
+ provider.issueToken(requestContext);
+
+ // construct the ws-trust security token response.
+ RequestedSecurityTokenType requestedSecurityToken = new
RequestedSecurityTokenType();
+ requestedSecurityToken.setAny(requestContext.getSecurityToken());
+
+ // TODO: create proof token and encrypt the token if needed
+
+ RequestSecurityTokenResponse response = new RequestSecurityTokenResponse();
+ if(request.getContext() != null)
+ response.setContext(request.getContext());
+
+ response.setTokenType(request.getTokenType());
+ response.setLifetime(request.getLifetime());
+ response.setAppliesTo(appliesTo);
+ response.setRequestedSecurityToken(requestedSecurityToken);
+ return response;
+ }
+ else
+ throw new WSTrustException("Unable to find a token provider for the token
request");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#renew(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
+ * javax.xml.ws.handler.MessageContext)
+ */
+ public RequestSecurityTokenResponse renew(RequestSecurityToken request, MessageContext
context)
+ throws WSTrustException
+ {
+ // TODO: implement renew logic.
+ throw new UnsupportedOperationException();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#validate(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
+ * javax.xml.ws.handler.MessageContext)
+ */
+ public RequestSecurityTokenResponse validate(RequestSecurityToken request,
MessageContext context)
+ throws WSTrustException
+ {
+ // TODO: implement validate logic.
+ throw new UnsupportedOperationException();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.identity.federation.api.wstrust.WSTrustRequestHandler#cancel(org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityToken,
+ * javax.xml.ws.handler.MessageContext)
+ */
+ public RequestSecurityTokenResponse cancel(RequestSecurityToken request,
MessageContext context)
+ throws WSTrustException
+ {
+ // TODO: implement cancel logic.
+ throw new UnsupportedOperationException();
+ }
+
+}
Added:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/StandardSTSConfiguration.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/StandardSTSConfiguration.java
(rev 0)
+++
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/StandardSTSConfiguration.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,190 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.api.wstrust;
+
+import java.security.PrivilegedActionException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.identity.federation.ws.trust.config.JBossSTSConfig;
+import org.jboss.identity.federation.ws.trust.config.ServiceProvider;
+import org.jboss.identity.federation.ws.trust.config.ServiceProviders;
+import org.jboss.identity.federation.ws.trust.config.TokenProvider;
+import org.jboss.identity.federation.ws.trust.config.TokenProviders;
+
+/**
+ * <p>
+ * </p>
+ *
+ * @author <a href="mailto:sguilhen@redhat.com">Stefan Guilhen</a>
+ */
+public class StandardSTSConfiguration implements STSConfiguration
+{
+
+ // the delegate contains all the information extracted from the jboss-sts.xml
configuration file.
+ private final JBossSTSConfig delegate;
+
+ private final Map<String, SecurityTokenProvider> tokenProviders = new
HashMap<String, SecurityTokenProvider>();
+
+ private final Map<String, ServiceProvider> spMetadata = new HashMap<String,
ServiceProvider>();
+
+ private final Map<String, Object> options = new HashMap<String,
Object>();
+
+ /**
+ *
+ */
+ public StandardSTSConfiguration()
+ {
+ this.delegate = new JBossSTSConfig();
+ // set the default values in the delegate.
+ this.delegate.setSTSName("JBossSTS");
+ this.delegate.setEncryptToken(false);
+ this.delegate.setTokenTimeout(3600);
+
this.delegate.setRequestHandler("org.jboss.identity.federation.api.wstrust.StandardRequestHandler");
+ }
+
+ /**
+ *
+ * @param config
+ */
+ public StandardSTSConfiguration(JBossSTSConfig config)
+ {
+ this.delegate = config;
+ // set the default request handler if one hasn't been specified.
+ if(this.delegate.getRequestHandler() == null)
+
this.delegate.setRequestHandler("org.jboss.identity.federation.api.wstrust.StandardRequestHandler");
+
+ // build the token-provider and service-metadata maps.
+ TokenProviders providers = this.delegate.getTokenProviders();
+ if (providers != null)
+ {
+ for (TokenProvider provider : providers.getTokenProvider())
+ {
+ try
+ {
+ SecurityTokenProvider tokenProvider = (SecurityTokenProvider)
SecurityActions.instantiateClass(provider
+ .getProviderClass());
+ this.tokenProviders.put(provider.getTokenType(), tokenProvider);
+ }
+ catch (PrivilegedActionException pae)
+ {
+ throw new RuntimeException("Unable to instantiate token provider
" + provider.getProviderClass(), pae);
+ }
+ }
+ }
+ ServiceProviders serviceProviders = this.delegate.getServiceProviders();
+ if(serviceProviders != null)
+ {
+ for (ServiceProvider provider : serviceProviders.getServiceProvider())
+ this.spMetadata.put(provider.getEndpoint(), provider);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getSTSName()
+ */
+ public String getSTSName()
+ {
+ return this.delegate.getSTSName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.identity.federation.api.wstrust.STSConfiguration#getEncryptIssuedToken()
+ */
+ public boolean getEncryptIssuedToken()
+ {
+ return this.delegate.isEncryptToken();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.identity.federation.api.wstrust.STSConfiguration#getIssuedTokenTimeout()
+ */
+ public long getIssuedTokenTimeout()
+ {
+ return this.delegate.getTokenTimeout();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.identity.federation.api.wstrust.STSConfiguration#getRequestHandlerClass()
+ */
+ public String getRequestHandlerClass()
+ {
+ return this.delegate.getRequestHandler();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getOptions()
+ */
+ public Map<String, Object> getOptions()
+ {
+ return this.options;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.identity.federation.api.wstrust.STSConfiguration#getProviderForService(java.lang.String)
+ */
+ public SecurityTokenProvider getProviderForService(String serviceName)
+ {
+ ServiceProvider provider = this.spMetadata.get(serviceName);
+ if (provider != null)
+ {
+ return this.tokenProviders.get(provider.getTokenType());
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.identity.federation.api.wstrust.STSConfiguration#getProviderForTokenType(java.lang.String)
+ */
+ public SecurityTokenProvider getProviderForTokenType(String tokenType)
+ {
+ return this.tokenProviders.get(tokenType);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.jboss.identity.federation.api.wstrust.STSConfiguration#getTokenTypeForService(java.lang.String)
+ */
+ public String getTokenTypeForService(String serviceName)
+ {
+ ServiceProvider provider = this.spMetadata.get(serviceName);
+ if (provider != null)
+ return provider.getTokenType();
+ return null;
+ }
+
+}
Modified:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java 2009-03-26
21:30:27 UTC (rev 404)
+++
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -21,6 +21,9 @@
*/
package org.jboss.identity.federation.api.wstrust;
+import java.io.InputStream;
+import java.net.URL;
+
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
@@ -40,6 +43,7 @@
import
org.jboss.identity.federation.ws.trust.RequestSecurityTokenResponseCollectionType;
import org.jboss.identity.federation.ws.trust.RequestSecurityTokenResponseType;
import org.jboss.identity.federation.ws.trust.RequestSecurityTokenType;
+import org.jboss.identity.federation.ws.trust.config.JBossSTSConfig;
/**
* <p>
@@ -107,14 +111,25 @@
try
{
Unmarshaller unmarshaller = this.context.createUnmarshaller();
- JAXBElement<?> element = (JAXBElement<?>)
unmarshaller.unmarshal(request);
- // is this a single token request or a collection of token requests
- if (element.getDeclaredType().equals(RequestSecurityTokenType.class))
- return new RequestSecurityToken((RequestSecurityTokenType)
element.getValue());
- else if
(element.getDeclaredType().equals(RequestSecurityTokenCollectionType.class))
- return new
RequestSecurityTokenCollection((RequestSecurityTokenCollectionType) element.getValue());
+ Object object = unmarshaller.unmarshal(request);
+ // check the type of the unmarshalled object.
+ if (object instanceof RequestSecurityTokenType)
+ return new RequestSecurityToken((RequestSecurityTokenType) object);
+ else if (object instanceof RequestSecurityTokenCollectionType)
+ return new
RequestSecurityTokenCollection((RequestSecurityTokenCollectionType) object);
+ else if (object instanceof JAXBElement)
+ {
+ JAXBElement<?> element = (JAXBElement<?>)
unmarshaller.unmarshal(request);
+ // is this a single token request or a collection of token requests
+ if (element.getDeclaredType().equals(RequestSecurityTokenType.class))
+ return new RequestSecurityToken((RequestSecurityTokenType)
element.getValue());
+ else if
(element.getDeclaredType().equals(RequestSecurityTokenCollectionType.class))
+ return new
RequestSecurityTokenCollection((RequestSecurityTokenCollectionType) element.getValue());
+ else
+ throw new RuntimeException("Invalid request type: " +
element.getDeclaredType());
+ }
else
- throw new RuntimeException("Invalid request type: " +
element.getDeclaredType());
+ throw new RuntimeException("Invalid request type: " +
object.getClass().getName());
}
catch (Exception e)
{
@@ -224,4 +239,28 @@
}
}
+ /**
+ *
+ * @param configurationFile
+ * @return
+ */
+ public STSConfiguration parseConfiguration(URL configurationFile)
+ {
+ if (configurationFile == null)
+ return new StandardSTSConfiguration();
+
+ try
+ {
+ InputStream stream = configurationFile.openStream();
+ JAXBContext context =
JAXBContext.newInstance("org.jboss.identity.federation.ws.trust.config");
+ Unmarshaller unmarshaller = context.createUnmarshaller();
+ JBossSTSConfig jbossConfig = (JBossSTSConfig) unmarshaller.unmarshal(stream);
+ return new StandardSTSConfiguration(jbossConfig);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Error parsing the configuration file",
e);
+ }
+ }
+
}
Modified:
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustServiceFactory.java
===================================================================
---
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustServiceFactory.java 2009-03-26
21:30:27 UTC (rev 404)
+++
identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustServiceFactory.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -55,21 +55,17 @@
return factory;
}
+ /**
+ *
+ * @param configuration
+ * @return
+ */
public WSTrustRequestHandler createRequestHandler(STSConfiguration configuration)
{
- // TODO: obtain the actual WSTrustRequestHandler implementation class from the
configuration.
- String handlerClassName =
"org.jboss.identity.federation.api.wstrust.JBossWSTrustRequestHandler";
+ String handlerClassName = configuration.getRequestHandlerClass();
try
{
- Class<?> handlerClass = null;
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (loader == null)
- handlerClass = Class.forName(handlerClassName);
- else
- handlerClass = loader.loadClass(handlerClassName);
-
- // TODO: instantiate the class using a privileged block.
- WSTrustRequestHandler handler = (WSTrustRequestHandler)
handlerClass.newInstance();
+ WSTrustRequestHandler handler = (WSTrustRequestHandler)
SecurityActions.instantiateClass(handlerClassName);
handler.initialize(configuration);
return handler;
}
Modified:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenCollectionType.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenCollectionType.java 2009-03-26
21:30:27 UTC (rev 404)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenCollectionType.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -13,6 +13,7 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@@ -44,6 +45,7 @@
@XmlType(name = "RequestSecurityTokenCollectionType", propOrder = {
"requestSecurityToken"
})
+@XmlRootElement
public class RequestSecurityTokenCollectionType {
@XmlElement(name = "RequestSecurityToken", required = true)
Modified:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenResponseCollectionType.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenResponseCollectionType.java 2009-03-26
21:30:27 UTC (rev 404)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenResponseCollectionType.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -16,6 +16,7 @@
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
@@ -48,6 +49,7 @@
@XmlType(name = "RequestSecurityTokenResponseCollectionType", propOrder = {
"requestSecurityTokenResponse"
})
+@XmlRootElement
public class RequestSecurityTokenResponseCollectionType {
@XmlElement(name = "RequestSecurityTokenResponse", required = true)
Modified:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenResponseType.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenResponseType.java 2009-03-26
21:30:27 UTC (rev 404)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenResponseType.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -17,6 +17,7 @@
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
@@ -85,6 +86,7 @@
@XmlType(name = "RequestSecurityTokenResponseType", propOrder = {
"any"
})
+@XmlRootElement
public class RequestSecurityTokenResponseType {
@XmlAnyElement(lax = true)
Modified:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenType.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenType.java 2009-03-26
21:30:27 UTC (rev 404)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/RequestSecurityTokenType.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -12,14 +12,17 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;
+
import org.w3c.dom.Element;
@@ -80,6 +83,7 @@
@XmlType(name = "RequestSecurityTokenType", propOrder = {
"any"
})
+@XmlRootElement
public class RequestSecurityTokenType {
@XmlAnyElement(lax = true)
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/JBossSTSConfig.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/JBossSTSConfig.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/JBossSTSConfig.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,295 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.03.26 at 04:57:03 PM GMT-03:00
+//
+
+
+package org.jboss.identity.federation.ws.trust.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}STSName"
minOccurs="0"/>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}TokenTimeout"
minOccurs="0"/>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}EncryptToken"
minOccurs="0"/>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}SecurityDomain"
minOccurs="0"/>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}Keystore"
minOccurs="0"/>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}Truststore"
minOccurs="0"/>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}RequestHandler"
minOccurs="0"/>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}TokenProviders"
minOccurs="0"/>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}ServiceProviders"
minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "stsName",
+ "tokenTimeout",
+ "encryptToken",
+ "securityDomain",
+ "keystore",
+ "truststore",
+ "requestHandler",
+ "tokenProviders",
+ "serviceProviders"
+})
+@XmlRootElement(name = "JBossSTSConfig")
+public class JBossSTSConfig {
+
+ @XmlElement(name = "STSName", defaultValue = "JBossSTS")
+ protected String stsName;
+ @XmlElement(name = "TokenTimeout", defaultValue = "3600")
+ protected Integer tokenTimeout;
+ @XmlElement(name = "EncryptToken", defaultValue = "false")
+ protected Boolean encryptToken;
+ @XmlElement(name = "SecurityDomain")
+ protected String securityDomain;
+ @XmlElement(name = "Keystore")
+ protected Keystore keystore;
+ @XmlElement(name = "Truststore")
+ protected Truststore truststore;
+ @XmlElement(name = "RequestHandler")
+ protected String requestHandler;
+ @XmlElement(name = "TokenProviders")
+ protected TokenProviders tokenProviders;
+ @XmlElement(name = "ServiceProviders")
+ protected ServiceProviders serviceProviders;
+
+ /**
+ * Gets the value of the stsName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSTSName() {
+ return stsName;
+ }
+
+ /**
+ * Sets the value of the stsName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSTSName(String value) {
+ this.stsName = value;
+ }
+
+ /**
+ * Gets the value of the tokenTimeout property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getTokenTimeout() {
+ return tokenTimeout;
+ }
+
+ /**
+ * Sets the value of the tokenTimeout property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setTokenTimeout(Integer value) {
+ this.tokenTimeout = value;
+ }
+
+ /**
+ * Gets the value of the encryptToken property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isEncryptToken() {
+ return encryptToken;
+ }
+
+ /**
+ * Sets the value of the encryptToken property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setEncryptToken(Boolean value) {
+ this.encryptToken = value;
+ }
+
+ /**
+ * Gets the value of the securityDomain property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSecurityDomain() {
+ return securityDomain;
+ }
+
+ /**
+ * Sets the value of the securityDomain property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSecurityDomain(String value) {
+ this.securityDomain = value;
+ }
+
+ /**
+ * Gets the value of the keystore property.
+ *
+ * @return
+ * possible object is
+ * {@link Keystore }
+ *
+ */
+ public Keystore getKeystore() {
+ return keystore;
+ }
+
+ /**
+ * Sets the value of the keystore property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Keystore }
+ *
+ */
+ public void setKeystore(Keystore value) {
+ this.keystore = value;
+ }
+
+ /**
+ * Gets the value of the truststore property.
+ *
+ * @return
+ * possible object is
+ * {@link Truststore }
+ *
+ */
+ public Truststore getTruststore() {
+ return truststore;
+ }
+
+ /**
+ * Sets the value of the truststore property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Truststore }
+ *
+ */
+ public void setTruststore(Truststore value) {
+ this.truststore = value;
+ }
+
+ /**
+ * Gets the value of the requestHandler property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRequestHandler() {
+ return requestHandler;
+ }
+
+ /**
+ * Sets the value of the requestHandler property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRequestHandler(String value) {
+ this.requestHandler = value;
+ }
+
+ /**
+ * Gets the value of the tokenProviders property.
+ *
+ * @return
+ * possible object is
+ * {@link TokenProviders }
+ *
+ */
+ public TokenProviders getTokenProviders() {
+ return tokenProviders;
+ }
+
+ /**
+ * Sets the value of the tokenProviders property.
+ *
+ * @param value
+ * allowed object is
+ * {@link TokenProviders }
+ *
+ */
+ public void setTokenProviders(TokenProviders value) {
+ this.tokenProviders = value;
+ }
+
+ /**
+ * Gets the value of the serviceProviders property.
+ *
+ * @return
+ * possible object is
+ * {@link ServiceProviders }
+ *
+ */
+ public ServiceProviders getServiceProviders() {
+ return serviceProviders;
+ }
+
+ /**
+ * Sets the value of the serviceProviders property.
+ *
+ * @param value
+ * allowed object is
+ * {@link ServiceProviders }
+ *
+ */
+ public void setServiceProviders(ServiceProviders value) {
+ this.serviceProviders = value;
+ }
+
+}
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/Keystore.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/Keystore.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/Keystore.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,126 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.03.26 at 04:57:03 PM GMT-03:00
+//
+
+
+package org.jboss.identity.federation.ws.trust.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * The Keystore type contains information about the keystore that holds the STS PKC
and associated
+ * private key. These are used to sign tokens, like SAML assertions.
+ *
+ *
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="location" use="required"
type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="password" use="required"
type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="alias"
type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "Keystore")
+public class Keystore {
+
+ @XmlAttribute(required = true)
+ protected String location;
+ @XmlAttribute(required = true)
+ protected String password;
+ @XmlAttribute
+ protected String alias;
+
+ /**
+ * Gets the value of the location property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getLocation() {
+ return location;
+ }
+
+ /**
+ * Sets the value of the location property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setLocation(String value) {
+ this.location = value;
+ }
+
+ /**
+ * Gets the value of the password property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * Sets the value of the password property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setPassword(String value) {
+ this.password = value;
+ }
+
+ /**
+ * Gets the value of the alias property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAlias() {
+ return alias;
+ }
+
+ /**
+ * Sets the value of the alias property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAlias(String value) {
+ this.alias = value;
+ }
+
+}
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ObjectFactory.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ObjectFactory.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ObjectFactory.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,178 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.03.26 at 04:57:03 PM GMT-03:00
+//
+
+
+package org.jboss.identity.federation.ws.trust.config;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.federation.jboss_sts package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _TokenTimeout_QNAME = new
QName("http://www.jboss.org/federation/jboss-sts", "TokenTimeout");
+ private final static QName _STSName_QNAME = new
QName("http://www.jboss.org/federation/jboss-sts", "STSName");
+ private final static QName _RequestHandler_QNAME = new
QName("http://www.jboss.org/federation/jboss-sts", "RequestHandler");
+ private final static QName _EncryptToken_QNAME = new
QName("http://www.jboss.org/federation/jboss-sts", "EncryptToken");
+ private final static QName _SecurityDomain_QNAME = new
QName("http://www.jboss.org/federation/jboss-sts", "SecurityDomain");
+ private final static QName _ProviderClass_QNAME = new
QName("http://www.jboss.org/federation/jboss-sts", "ProviderClass");
+ private final static QName _TruststoreAlias_QNAME = new
QName("http://www.jboss.org/federation/jboss-sts",
"TruststoreAlias");
+ private final static QName _TokenType_QNAME = new
QName("http://www.jboss.org/federation/jboss-sts", "TokenType");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema
derived classes for package: org.jboss.federation.jboss_sts
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link Keystore }
+ *
+ */
+ public Keystore createKeystore() {
+ return new Keystore();
+ }
+
+ /**
+ * Create an instance of {@link ServiceProviders }
+ *
+ */
+ public ServiceProviders createServiceProviders() {
+ return new ServiceProviders();
+ }
+
+ /**
+ * Create an instance of {@link TokenProvider }
+ *
+ */
+ public TokenProvider createTokenProvider() {
+ return new TokenProvider();
+ }
+
+ /**
+ * Create an instance of {@link JBossSTSConfig }
+ *
+ */
+ public JBossSTSConfig createJBossSTSConfig() {
+ return new JBossSTSConfig();
+ }
+
+ /**
+ * Create an instance of {@link Truststore }
+ *
+ */
+ public Truststore createTruststore() {
+ return new Truststore();
+ }
+
+ /**
+ * Create an instance of {@link TokenProviders }
+ *
+ */
+ public TokenProviders createTokenProviders() {
+ return new TokenProviders();
+ }
+
+ /**
+ * Create an instance of {@link ServiceProvider }
+ *
+ */
+ public ServiceProvider createServiceProvider() {
+ return new ServiceProvider();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code
>}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.jboss.org/federation/jboss-sts",
name = "TokenTimeout", defaultValue = "3600")
+ public JAXBElement<Integer> createTokenTimeout(Integer value) {
+ return new JAXBElement<Integer>(_TokenTimeout_QNAME, Integer.class, null,
value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code
>}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.jboss.org/federation/jboss-sts",
name = "STSName", defaultValue = "JBossSTS")
+ public JAXBElement<String> createSTSName(String value) {
+ return new JAXBElement<String>(_STSName_QNAME, String.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code
>}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.jboss.org/federation/jboss-sts",
name = "RequestHandler")
+ public JAXBElement<String> createRequestHandler(String value) {
+ return new JAXBElement<String>(_RequestHandler_QNAME, String.class, null,
value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code
>}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.jboss.org/federation/jboss-sts",
name = "EncryptToken", defaultValue = "false")
+ public JAXBElement<Boolean> createEncryptToken(Boolean value) {
+ return new JAXBElement<Boolean>(_EncryptToken_QNAME, Boolean.class, null,
value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code
>}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.jboss.org/federation/jboss-sts",
name = "SecurityDomain")
+ public JAXBElement<String> createSecurityDomain(String value) {
+ return new JAXBElement<String>(_SecurityDomain_QNAME, String.class, null,
value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code
>}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.jboss.org/federation/jboss-sts",
name = "ProviderClass")
+ public JAXBElement<String> createProviderClass(String value) {
+ return new JAXBElement<String>(_ProviderClass_QNAME, String.class, null,
value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code
>}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.jboss.org/federation/jboss-sts",
name = "TruststoreAlias")
+ public JAXBElement<String> createTruststoreAlias(String value) {
+ return new JAXBElement<String>(_TruststoreAlias_QNAME, String.class, null,
value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code
>}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.jboss.org/federation/jboss-sts",
name = "TokenType")
+ public JAXBElement<String> createTokenType(String value) {
+ return new JAXBElement<String>(_TokenType_QNAME, String.class, null,
value);
+ }
+
+}
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ServiceProvider.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ServiceProvider.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ServiceProvider.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,134 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.03.26 at 04:57:03 PM GMT-03:00
+//
+
+
+package org.jboss.identity.federation.ws.trust.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * The service provider type contains information about a specific service provider.
In particular,
+ * it specifies the type of the token that must be issued for the provider and the
alias of the
+ * provider's PKC in the truststore. This is used by the STS to locate the PKC
when encrypting the
+ * generated token.
+ *
+ *
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}TruststoreAlias"
minOccurs="0"/>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}TokenType"/>
+ * </sequence>
+ * <attribute name="endpoint"
type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "truststoreAlias",
+ "tokenType"
+})
+@XmlRootElement(name = "ServiceProvider")
+public class ServiceProvider {
+
+ @XmlElement(name = "TruststoreAlias")
+ protected String truststoreAlias;
+ @XmlElement(name = "TokenType", required = true)
+ protected String tokenType;
+ @XmlAttribute
+ protected String endpoint;
+
+ /**
+ * Gets the value of the truststoreAlias property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTruststoreAlias() {
+ return truststoreAlias;
+ }
+
+ /**
+ * Sets the value of the truststoreAlias property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTruststoreAlias(String value) {
+ this.truststoreAlias = value;
+ }
+
+ /**
+ * Gets the value of the tokenType property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTokenType() {
+ return tokenType;
+ }
+
+ /**
+ * Sets the value of the tokenType property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTokenType(String value) {
+ this.tokenType = value;
+ }
+
+ /**
+ * Gets the value of the endpoint property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getEndpoint() {
+ return endpoint;
+ }
+
+ /**
+ * Sets the value of the endpoint property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setEndpoint(String value) {
+ this.endpoint = value;
+ }
+
+}
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ServiceProviders.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ServiceProviders.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/ServiceProviders.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,82 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.03.26 at 04:57:03 PM GMT-03:00
+//
+
+
+package org.jboss.identity.federation.ws.trust.config;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * The service providers specify the token type expected by each service provider.
+ *
+ *
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}ServiceProvider"
maxOccurs="unbounded"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "serviceProvider"
+})
+@XmlRootElement(name = "ServiceProviders")
+public class ServiceProviders {
+
+ @XmlElement(name = "ServiceProvider", required = true)
+ protected List<ServiceProvider> serviceProvider;
+
+ /**
+ * Gets the value of the serviceProvider property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the
serviceProvider property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getServiceProvider().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link ServiceProvider }
+ *
+ *
+ */
+ public List<ServiceProvider> getServiceProvider() {
+ if (serviceProvider == null) {
+ serviceProvider = new ArrayList<ServiceProvider>();
+ }
+ return this.serviceProvider;
+ }
+
+}
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/TokenProvider.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/TokenProvider.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/TokenProvider.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,99 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.03.26 at 04:57:03 PM GMT-03:00
+//
+
+
+package org.jboss.identity.federation.ws.trust.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}ProviderClass"/...
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}TokenType"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "providerClass",
+ "tokenType"
+})
+@XmlRootElement(name = "TokenProvider")
+public class TokenProvider {
+
+ @XmlElement(name = "ProviderClass", required = true)
+ protected String providerClass;
+ @XmlElement(name = "TokenType", required = true)
+ protected String tokenType;
+
+ /**
+ * Gets the value of the providerClass property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getProviderClass() {
+ return providerClass;
+ }
+
+ /**
+ * Sets the value of the providerClass property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setProviderClass(String value) {
+ this.providerClass = value;
+ }
+
+ /**
+ * Gets the value of the tokenType property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTokenType() {
+ return tokenType;
+ }
+
+ /**
+ * Sets the value of the tokenType property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTokenType(String value) {
+ this.tokenType = value;
+ }
+
+}
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/TokenProviders.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/TokenProviders.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/TokenProviders.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,84 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.03.26 at 04:57:03 PM GMT-03:00
+//
+
+
+package org.jboss.identity.federation.ws.trust.config;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * The token providers specify the classes that handle the requests for each type of
security Token.
+ * For example, a SAMLTokenProvider may be used to generate SAML token, while a
X509TokenProvider
+ * may be used to generate X.509 tokens (certificates).
+ *
+ *
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element
ref="{http://www.jboss.org/federation/jboss-sts}TokenProvider"
maxOccurs="unbounded"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "tokenProvider"
+})
+@XmlRootElement(name = "TokenProviders")
+public class TokenProviders {
+
+ @XmlElement(name = "TokenProvider", required = true)
+ protected List<TokenProvider> tokenProvider;
+
+ /**
+ * Gets the value of the tokenProvider property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the
tokenProvider property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getTokenProvider().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link TokenProvider }
+ *
+ *
+ */
+ public List<TokenProvider> getTokenProvider() {
+ if (tokenProvider == null) {
+ tokenProvider = new ArrayList<TokenProvider>();
+ }
+ return this.tokenProvider;
+ }
+
+}
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/Truststore.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/Truststore.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/Truststore.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,100 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.03.26 at 04:57:03 PM GMT-03:00
+//
+
+
+package org.jboss.identity.federation.ws.trust.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * The Truststore type contains information about the truststore that holds the
service providers
+ * PKCs (public key certificates). When tokens need to be encrypted, the service
provider's PKC
+ * is used to perform the encryption.
+ *
+ *
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="location" use="required"
type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="password" use="required"
type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "Truststore")
+public class Truststore {
+
+ @XmlAttribute(required = true)
+ protected String location;
+ @XmlAttribute(required = true)
+ protected String password;
+
+ /**
+ * Gets the value of the location property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getLocation() {
+ return location;
+ }
+
+ /**
+ * Sets the value of the location property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setLocation(String value) {
+ this.location = value;
+ }
+
+ /**
+ * Gets the value of the password property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * Sets the value of the password property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setPassword(String value) {
+ this.password = value;
+ }
+
+}
Added:
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/package-info.java
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/package-info.java
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/identity/federation/ws/trust/config/package-info.java 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.03.26 at 04:57:03 PM GMT-03:00
+//
+
+(a)javax.xml.bind.annotation.XmlSchema(namespace =
"http://www.jboss.org/federation/jboss-sts", elementFormDefault =
javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.jboss.identity.federation.ws.trust.config;
Added:
identity-federation/trunk/identity-fed-model/src/main/resources/schema/wstrust/v1_3/jboss-sts.xsd
===================================================================
---
identity-federation/trunk/identity-fed-model/src/main/resources/schema/wstrust/v1_3/jboss-sts.xsd
(rev 0)
+++
identity-federation/trunk/identity-fed-model/src/main/resources/schema/wstrust/v1_3/jboss-sts.xsd 2009-03-27
13:12:48 UTC (rev 405)
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:sts="http://www.jboss.org/federation/jboss-sts"
+
targetNamespace="http://www.jboss.org/federation/jboss-sts"
+ elementFormDefault="qualified">
+
+ <xsd:element name="JBossSTSConfig">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element ref="sts:STSName" minOccurs="0"/>
+ <xsd:element ref="sts:TokenTimeout" minOccurs="0"/>
+ <xsd:element ref="sts:EncryptToken" minOccurs="0"/>
+ <xsd:element ref="sts:SecurityDomain" minOccurs="0"/>
+ <xsd:element ref="sts:Keystore" minOccurs="0"/>
+ <xsd:element ref="sts:Truststore" minOccurs="0"/>
+ <xsd:element ref="sts:RequestHandler" minOccurs="0"/>
+ <xsd:element ref="sts:TokenProviders" minOccurs="0"/>
+ <xsd:element ref="sts:ServiceProviders" minOccurs="0"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="STSName" default="JBossSTS"
type="xsd:string"/>
+
+ <xsd:element name="TokenTimeout" default="3600"
type="xsd:int"/>
+
+ <xsd:element name="EncryptToken" default="false"
type="xsd:boolean"/>
+
+ <!-- a security domain can be used to locate the key and trust stores -->
+ <xsd:element name="SecurityDomain" type="xsd:string"/>
+
+ <xsd:element name="Keystore">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:documentation>
+ The Keystore type contains information about the keystore that holds the STS PKC and
associated
+ private key. These are used to sign tokens, like SAML assertions.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="location" type="xsd:string"
use="required"/>
+ <xsd:attribute name="password" type="xsd:string"
use="required"/>
+ <xsd:attribute name="alias" type="xsd:string"
use="optional"/>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="Truststore">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:documentation>
+ The Truststore type contains information about the truststore that holds the service
providers
+ PKCs (public key certificates). When tokens need to be encrypted, the service
provider's PKC
+ is used to perform the encryption.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="location" type="xsd:string"
use="required"/>
+ <xsd:attribute name="password" type="xsd:string"
use="required"/>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="RequestHandler" type="xsd:string"/>
+
+ <xsd:element name="TokenProviders">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:documentation>
+ The token providers specify the classes that handle the requests for each type of
security Token.
+ For example, a SAMLTokenProvider may be used to generate SAML token, while a
X509TokenProvider
+ may be used to generate X.509 tokens (certificates).
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element ref="sts:TokenProvider" minOccurs="1"
maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="TokenProvider">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element ref="sts:ProviderClass" minOccurs="1"/>
+ <xsd:element ref="sts:TokenType" minOccurs="1"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="ProviderClass" type="xsd:string"/>
+
+ <xsd:element name="TokenType" type="xsd:string"/>
+
+ <xsd:element name="ServiceProviders">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:documentation>
+ The service providers specify the token type expected by each service provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element ref="sts:ServiceProvider" minOccurs="1"
maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="ServiceProvider">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:documentation>
+ The service provider type contains information about a specific service provider. In
particular,
+ it specifies the type of the token that must be issued for the provider and the
alias of the
+ provider's PKC in the truststore. This is used by the STS to locate the PKC when
encrypting the
+ generated token.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element ref="sts:TruststoreAlias" minOccurs="0"/>
+ <xsd:element ref="sts:TokenType" minOccurs="1"/>
+ </xsd:sequence>
+ <xsd:attribute name="endpoint" type="xsd:string"/>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="TruststoreAlias" type="xsd:string"/>
+</xsd:schema>
\ No newline at end of file