From jboss-identity-commits at lists.jboss.org Fri Mar 27 10:46:50 2009 Content-Type: multipart/mixed; boundary="===============7775021473429679562==" MIME-Version: 1.0 From: jboss-identity-commits at lists.jboss.org To: jboss-identity-commits at lists.jboss.org Subject: [jboss-identity-commits] JBoss Identity SVN: r406 - in identity-federation/trunk: identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/trust and 5 other directories. Date: Fri, 27 Mar 2009 10:46:50 -0400 Message-ID: --===============7775021473429679562== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sguilhen(a)redhat.com Date: 2009-03-27 10:46:49 -0400 (Fri, 27 Mar 2009) New Revision: 406 Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/config/trust/ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/config/trust/JBossSTSConfig.java identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/config/trust/Keystore.java identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/config/trust/ObjectFactory.java identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/config/trust/ServiceProvider.java identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/config/trust/ServiceProviders.java identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/config/trust/TokenProvider.java identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/config/trust/TokenProviders.java identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/config/trust/Truststore.java identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/config/trust/package-info.java identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/jboss/trust/JBossSTSConfiguration.java identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/jboss/trust/SecurityActions.java identity-federation/trunk/identity-bindings/src/main/resources/schema/co= nfig/jboss-sts.xsd Removed: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/ident= ity/federation/api/wstrust/StandardSTSConfiguration.java identity-federation/trunk/identity-fed-model/src/main/java/org/jboss/ide= ntity/federation/ws/trust/config/ identity-federation/trunk/identity-fed-model/src/main/resources/schema/w= strust/v1_3/jboss-sts.xsd Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/iden= tity/federation/bindings/jboss/trust/JBossSTS.java identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/ident= ity/federation/api/wstrust/WSTrustJAXBFactory.java Log: Moved STS JAXB configuration model to identity-bindings. Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/= identity/federation/bindings/config/trust/JBossSTSConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/JBossSTSConfig.java = (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/JBossSTSConfig.java 2009-03-27 14:46= :49 UTC (rev 406) @@ -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 http://java.sun.com/xml/ja= xb = +// Any modifications to this file will be lost upon recompilation of the s= ource schema. = +// Generated on: 2009.03.27 at 11:21:21 AM GMT-03:00 = +// + + +package org.jboss.identity.federation.bindings.config.trust; + +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; + + +/** + *

Java class for anonymous complex type. + * = + *

The following schema fragment specifies the expected content contain= ed within this class. + * = + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base=3D"{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}STSName=
" minOccurs=3D"0"/>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}TokenTi=
meout" minOccurs=3D"0"/>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}Encrypt=
Token" minOccurs=3D"0"/>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}Securit=
yDomain" minOccurs=3D"0"/>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}Keystor=
e" minOccurs=3D"0"/>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}Trustst=
ore" minOccurs=3D"0"/>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}Request=
Handler" minOccurs=3D"0"/>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}TokenPr=
oviders" minOccurs=3D"0"/>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}Service=
Providers" minOccurs=3D"0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * = + * = + */ +(a)XmlAccessorType(XmlAccessType.FIELD) +(a)XmlType(name =3D "", propOrder =3D { + "stsName", + "tokenTimeout", + "encryptToken", + "securityDomain", + "keystore", + "truststore", + "requestHandler", + "tokenProviders", + "serviceProviders" +}) +(a)XmlRootElement(name =3D "JBossSTSConfig") +public class JBossSTSConfig { + + @XmlElement(name =3D "STSName", defaultValue =3D "JBossSTS") + protected String stsName; + @XmlElement(name =3D "TokenTimeout", defaultValue =3D "3600") + protected Integer tokenTimeout; + @XmlElement(name =3D "EncryptToken", defaultValue =3D "false") + protected Boolean encryptToken; + @XmlElement(name =3D "SecurityDomain") + protected String securityDomain; + @XmlElement(name =3D "Keystore") + protected Keystore keystore; + @XmlElement(name =3D "Truststore") + protected Truststore truststore; + @XmlElement(name =3D "RequestHandler") + protected String requestHandler; + @XmlElement(name =3D "TokenProviders") + protected TokenProviders tokenProviders; + @XmlElement(name =3D "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 =3D 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 =3D 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 =3D 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 =3D 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 =3D 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 =3D 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 =3D 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 =3D 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 =3D value; + } + +} Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/= identity/federation/bindings/config/trust/Keystore.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/Keystore.java = (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/Keystore.java 2009-03-27 14:46:49 UT= C (rev 406) @@ -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 http://java.sun.com/xml/ja= xb = +// Any modifications to this file will be lost upon recompilation of the s= ource schema. = +// Generated on: 2009.03.27 at 11:21:21 AM GMT-03:00 = +// + + +package org.jboss.identity.federation.bindings.config.trust; + +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 hol= ds the STS PKC and associated + * private key. These are used to sign tokens, like SAML assertions. + * = + * = + *

Java class for anonymous complex type. + * = + *

The following schema fragment specifies the expected content contain= ed within this class. + * = + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base=3D"{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name=3D"location" use=3D"required" type=3D"{http://=
www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name=3D"password" use=3D"required" type=3D"{http://=
www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name=3D"alias" type=3D"{http://www.w3.org/2001/XMLS=
chema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * = + * = + */ +(a)XmlAccessorType(XmlAccessType.FIELD) +(a)XmlType(name =3D "") +(a)XmlRootElement(name =3D "Keystore") +public class Keystore { + + @XmlAttribute(required =3D true) + protected String location; + @XmlAttribute(required =3D 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 =3D 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 =3D 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 =3D value; + } + +} Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/= identity/federation/bindings/config/trust/ObjectFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/ObjectFactory.java = (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/ObjectFactory.java 2009-03-27 14:46:= 49 UTC (rev 406) @@ -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 http://java.sun.com/xml/ja= xb = +// Any modifications to this file will be lost upon recompilation of the s= ource schema. = +// Generated on: 2009.03.27 at 11:21:21 AM GMT-03:00 = +// + + +package org.jboss.identity.federation.bindings.config.trust; + +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 jboss.identity_trust.config._1 package. = + *

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. + * = + */ +(a)XmlRegistry +public class ObjectFactory { + + private final static QName _TokenTimeout_QNAME =3D new QName("urn:jbos= s:identity-trust:config:1.0", "TokenTimeout"); + private final static QName _STSName_QNAME =3D new QName("urn:jboss:ide= ntity-trust:config:1.0", "STSName"); + private final static QName _RequestHandler_QNAME =3D new QName("urn:jb= oss:identity-trust:config:1.0", "RequestHandler"); + private final static QName _EncryptToken_QNAME =3D new QName("urn:jbos= s:identity-trust:config:1.0", "EncryptToken"); + private final static QName _SecurityDomain_QNAME =3D new QName("urn:jb= oss:identity-trust:config:1.0", "SecurityDomain"); + private final static QName _ProviderClass_QNAME =3D new QName("urn:jbo= ss:identity-trust:config:1.0", "ProviderClass"); + private final static QName _TruststoreAlias_QNAME =3D new QName("urn:j= boss:identity-trust:config:1.0", "TruststoreAlias"); + private final static QName _TokenType_QNAME =3D new QName("urn:jboss:i= dentity-trust:config:1.0", "TokenType"); + + /** + * Create a new ObjectFactory that can be used to create new instances= of schema derived classes for package: jboss.identity_trust.config._1 + * = + */ + 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 =3D "urn:jboss:identity-trust:config:1.0", n= ame =3D "TokenTimeout", defaultValue =3D "3600") + public JAXBElement createTokenTimeout(Integer value) { + return new JAXBElement(_TokenTimeout_QNAME, Integer.class= , null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{= @code >}} + * = + */ + @XmlElementDecl(namespace =3D "urn:jboss:identity-trust:config:1.0", n= ame =3D "STSName", defaultValue =3D "JBossSTS") + public JAXBElement createSTSName(String value) { + return new JAXBElement(_STSName_QNAME, String.class, null,= value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{= @code >}} + * = + */ + @XmlElementDecl(namespace =3D "urn:jboss:identity-trust:config:1.0", n= ame =3D "RequestHandler") + public JAXBElement createRequestHandler(String value) { + return new JAXBElement(_RequestHandler_QNAME, String.class= , null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Boolean }= {@code >}} + * = + */ + @XmlElementDecl(namespace =3D "urn:jboss:identity-trust:config:1.0", n= ame =3D "EncryptToken", defaultValue =3D "false") + public JAXBElement createEncryptToken(Boolean value) { + return new JAXBElement(_EncryptToken_QNAME, Boolean.class= , null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{= @code >}} + * = + */ + @XmlElementDecl(namespace =3D "urn:jboss:identity-trust:config:1.0", n= ame =3D "SecurityDomain") + public JAXBElement createSecurityDomain(String value) { + return new JAXBElement(_SecurityDomain_QNAME, String.class= , null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{= @code >}} + * = + */ + @XmlElementDecl(namespace =3D "urn:jboss:identity-trust:config:1.0", n= ame =3D "ProviderClass") + public JAXBElement createProviderClass(String value) { + return new JAXBElement(_ProviderClass_QNAME, String.class,= null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{= @code >}} + * = + */ + @XmlElementDecl(namespace =3D "urn:jboss:identity-trust:config:1.0", n= ame =3D "TruststoreAlias") + public JAXBElement createTruststoreAlias(String value) { + return new JAXBElement(_TruststoreAlias_QNAME, String.clas= s, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{= @code >}} + * = + */ + @XmlElementDecl(namespace =3D "urn:jboss:identity-trust:config:1.0", n= ame =3D "TokenType") + public JAXBElement createTokenType(String value) { + return new JAXBElement(_TokenType_QNAME, String.class, nul= l, value); + } + +} Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/= identity/federation/bindings/config/trust/ServiceProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/ServiceProvider.java = (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/ServiceProvider.java 2009-03-27 14:4= 6:49 UTC (rev 406) @@ -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 http://java.sun.com/xml/ja= xb = +// Any modifications to this file will be lost upon recompilation of the s= ource schema. = +// Generated on: 2009.03.27 at 11:21:21 AM GMT-03:00 = +// + + +package org.jboss.identity.federation.bindings.config.trust; + +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 se= rvice provider. In particular, + * it specifies the type of the token that must be issued for the pro= vider and the alias of the + * provider's PKC in the truststore. This is used by the STS to locat= e the PKC when encrypting the + * generated token. = + * = + * = + *

Java class for anonymous complex type. + * = + *

The following schema fragment specifies the expected content contain= ed within this class. + * = + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base=3D"{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}Trustst=
oreAlias" minOccurs=3D"0"/>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}TokenTy=
pe"/>
+ *       </sequence>
+ *       <attribute name=3D"endpoint" type=3D"{http://www.w3.org/2001/X=
MLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * = + * = + */ +(a)XmlAccessorType(XmlAccessType.FIELD) +(a)XmlType(name =3D "", propOrder =3D { + "truststoreAlias", + "tokenType" +}) +(a)XmlRootElement(name =3D "ServiceProvider") +public class ServiceProvider { + + @XmlElement(name =3D "TruststoreAlias") + protected String truststoreAlias; + @XmlElement(name =3D "TokenType", required =3D 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 =3D 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 =3D 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 =3D value; + } + +} Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/= identity/federation/bindings/config/trust/ServiceProviders.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/ServiceProviders.java = (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/ServiceProviders.java 2009-03-27 14:= 46:49 UTC (rev 406) @@ -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 http://java.sun.com/xml/ja= xb = +// Any modifications to this file will be lost upon recompilation of the s= ource schema. = +// Generated on: 2009.03.27 at 11:21:21 AM GMT-03:00 = +// + + +package org.jboss.identity.federation.bindings.config.trust; + +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 serv= ice provider. + * = + * = + *

Java class for anonymous complex type. + * = + *

The following schema fragment specifies the expected content contain= ed within this class. + * = + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base=3D"{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}Service=
Provider" maxOccurs=3D"unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * = + * = + */ +(a)XmlAccessorType(XmlAccessType.FIELD) +(a)XmlType(name =3D "", propOrder =3D { + "serviceProvider" +}) +(a)XmlRootElement(name =3D "ServiceProviders") +public class ServiceProviders { + + @XmlElement(name =3D "ServiceProvider", required =3D true) + protected List serviceProvider; + + /** + * Gets the value of the serviceProvider property. + * = + *

+ * 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 set method for the serviceP= rovider property. + * = + *

+ * For example, to add a new item, do as follows: + *

+     *    getServiceProvider().add(newItem);
+     * 
+ * = + * = + *

+ * Objects of the following type(s) are allowed in the list + * {@link ServiceProvider } + * = + * = + */ + public List getServiceProvider() { + if (serviceProvider =3D=3D null) { + serviceProvider =3D new ArrayList(); + } + return this.serviceProvider; + } + +} Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/= identity/federation/bindings/config/trust/TokenProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/TokenProvider.java = (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/TokenProvider.java 2009-03-27 14:46:= 49 UTC (rev 406) @@ -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 http://java.sun.com/xml/ja= xb = +// Any modifications to this file will be lost upon recompilation of the s= ource schema. = +// Generated on: 2009.03.27 at 11:21:21 AM GMT-03:00 = +// + + +package org.jboss.identity.federation.bindings.config.trust; + +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; + + +/** + *

Java class for anonymous complex type. + * = + *

The following schema fragment specifies the expected content contain= ed within this class. + * = + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base=3D"{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}Provide=
rClass"/>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}TokenTy=
pe"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * = + * = + */ +(a)XmlAccessorType(XmlAccessType.FIELD) +(a)XmlType(name =3D "", propOrder =3D { + "providerClass", + "tokenType" +}) +(a)XmlRootElement(name =3D "TokenProvider") +public class TokenProvider { + + @XmlElement(name =3D "ProviderClass", required =3D true) + protected String providerClass; + @XmlElement(name =3D "TokenType", required =3D 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 =3D 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 =3D value; + } + +} Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/= identity/federation/bindings/config/trust/TokenProviders.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/TokenProviders.java = (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/TokenProviders.java 2009-03-27 14:46= :49 UTC (rev 406) @@ -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 http://java.sun.com/xml/ja= xb = +// Any modifications to this file will be lost upon recompilation of the s= ource schema. = +// Generated on: 2009.03.27 at 11:21:21 AM GMT-03:00 = +// + + +package org.jboss.identity.federation.bindings.config.trust; + +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 f= or each type of security Token. + * For example, a SAMLTokenProvider may be used to generate SAML toke= n, while a X509TokenProvider + * may be used to generate X.509 tokens (certificates). + * = + * = + *

Java class for anonymous complex type. + * = + *

The following schema fragment specifies the expected content contain= ed within this class. + * = + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base=3D"{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref=3D"{urn:jboss:identity-trust:config:1.0}TokenPr=
ovider" maxOccurs=3D"unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * = + * = + */ +(a)XmlAccessorType(XmlAccessType.FIELD) +(a)XmlType(name =3D "", propOrder =3D { + "tokenProvider" +}) +(a)XmlRootElement(name =3D "TokenProviders") +public class TokenProviders { + + @XmlElement(name =3D "TokenProvider", required =3D true) + protected List tokenProvider; + + /** + * Gets the value of the tokenProvider property. + * = + *

+ * 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 set method for the tokenPro= vider property. + * = + *

+ * For example, to add a new item, do as follows: + *

+     *    getTokenProvider().add(newItem);
+     * 
+ * = + * = + *

+ * Objects of the following type(s) are allowed in the list + * {@link TokenProvider } + * = + * = + */ + public List getTokenProvider() { + if (tokenProvider =3D=3D null) { + tokenProvider =3D new ArrayList(); + } + return this.tokenProvider; + } + +} Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/= identity/federation/bindings/config/trust/Truststore.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/Truststore.java = (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/Truststore.java 2009-03-27 14:46:49 = UTC (rev 406) @@ -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 http://java.sun.com/xml/ja= xb = +// Any modifications to this file will be lost upon recompilation of the s= ource schema. = +// Generated on: 2009.03.27 at 11:21:21 AM GMT-03:00 = +// + + +package org.jboss.identity.federation.bindings.config.trust; + +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. = + * = + * = + *

Java class for anonymous complex type. + * = + *

The following schema fragment specifies the expected content contain= ed within this class. + * = + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base=3D"{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name=3D"location" use=3D"required" type=3D"{http://=
www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name=3D"password" use=3D"required" type=3D"{http://=
www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * = + * = + */ +(a)XmlAccessorType(XmlAccessType.FIELD) +(a)XmlType(name =3D "") +(a)XmlRootElement(name =3D "Truststore") +public class Truststore { + + @XmlAttribute(required =3D true) + protected String location; + @XmlAttribute(required =3D 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 =3D 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 =3D value; + } + +} Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/= identity/federation/bindings/config/trust/package-info.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/package-info.java = (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/config/trust/package-info.java 2009-03-27 14:46:4= 9 UTC (rev 406) @@ -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 http://java.sun.com/xml/ja= xb = +// Any modifications to this file will be lost upon recompilation of the s= ource schema. = +// Generated on: 2009.03.27 at 11:21:21 AM GMT-03:00 = +// + +(a)javax.xml.bind.annotation.XmlSchema(namespace =3D "urn:jboss:identity-t= rust:config:1.0", elementFormDefault =3D javax.xml.bind.annotation.XmlNsFor= m.QUALIFIED) +package org.jboss.identity.federation.bindings.config.trust; Modified: identity-federation/trunk/identity-bindings/src/main/java/org/jbo= ss/identity/federation/bindings/jboss/trust/JBossSTS.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/jboss/trust/JBossSTS.java 2009-03-27 13:12:48 UTC= (rev 405) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/jboss/trust/JBossSTS.java 2009-03-27 14:46:49 UTC= (rev 406) @@ -21,9 +21,12 @@ */ package org.jboss.identity.federation.bindings.jboss.trust; = +import java.io.InputStream; import java.net.URL; = import javax.annotation.Resource; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Unmarshaller; import javax.xml.transform.Source; import javax.xml.ws.Service; import javax.xml.ws.ServiceMode; @@ -43,6 +46,7 @@ import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityT= okenCollection; import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityT= okenResponse; import org.jboss.identity.federation.api.wstrust.protocol.RequestSecurityT= okenResponseCollection; +import org.jboss.identity.federation.bindings.config.trust.JBossSTSConfig; = /** *

@@ -59,6 +63,8 @@ @Resource protected WebServiceContext context; = + protected STSConfiguration config; + = /* * (non-Javadoc) * = @@ -85,7 +91,10 @@ */ protected Source handleTokenRequest(RequestSecurityToken request) { - WSTrustRequestHandler handler =3D WSTrustServiceFactory.getInstance(= ).createRequestHandler(this.getConfiguration()); + if(this.config =3D=3D null) + this.config =3D this.getConfiguration(); + = + WSTrustRequestHandler handler =3D WSTrustServiceFactory.getInstance(= ).createRequestHandler(this.config); String requestType =3D request.getRequestType().toString(); = try @@ -134,19 +143,6 @@ // add the single response to a RequestSecurityTokenResponse collect= ion, as per the specification. RequestSecurityTokenResponseCollection responseCollection =3D new Re= questSecurityTokenResponseCollection(); responseCollection.addRequestSecurityTokenResponse(response); - return this.marshallResponse(responseCollection); - } - - /** - *

- * Marshalls the specified {@code RequestSecurityTokenResponseCollectio= n} into a {@code Source} instance. - *

- * = - * @param responseCollection the {@code RequestSecurityTokenResponseCol= lection} to be marshalled. - * @return the resulting {@code Source} instance. - */ - protected Source marshallResponse(RequestSecurityTokenResponseCollectio= n responseCollection) - { return WSTrustJAXBFactory.getInstance().marshallRequestSecurityToken= Response(responseCollection); } = @@ -161,6 +157,20 @@ { // get the configuration file and parse it. URL configurationFile =3D Thread.currentThread().getContextClassLoad= er().getResource("jboss-sts.xml"); - return WSTrustJAXBFactory.getInstance().parseConfiguration(configura= tionFile); + if (configurationFile =3D=3D null) + return new JBossSTSConfiguration(); + + try + { + InputStream stream =3D configurationFile.openStream(); + JAXBContext context =3D JAXBContext.newInstance("org.jboss.identi= ty.federation.bindings.config.trust"); + Unmarshaller unmarshaller =3D context.createUnmarshaller(); + JBossSTSConfig jbossConfig =3D (JBossSTSConfig) unmarshaller.unma= rshal(stream); + return new JBossSTSConfiguration(jbossConfig); + } + catch (Exception e) + { + throw new RuntimeException("Error parsing the configuration file"= , e); + } } } Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/= identity/federation/bindings/jboss/trust/JBossSTSConfiguration.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/jboss/trust/JBossSTSConfiguration.java = (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/jboss/trust/JBossSTSConfiguration.java 2009-03-27= 14:46:49 UTC (rev 406) @@ -0,0 +1,192 @@ +/* + * 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 java.security.PrivilegedActionException; +import java.util.HashMap; +import java.util.Map; + +import org.jboss.identity.federation.api.wstrust.STSConfiguration; +import org.jboss.identity.federation.api.wstrust.SecurityTokenProvider; +import org.jboss.identity.federation.bindings.config.trust.JBossSTSConfig; +import org.jboss.identity.federation.bindings.config.trust.ServiceProvider; +import org.jboss.identity.federation.bindings.config.trust.ServiceProvider= s; +import org.jboss.identity.federation.bindings.config.trust.TokenProvider; +import org.jboss.identity.federation.bindings.config.trust.TokenProviders; + +/** + *

+ *

+ * = + * @author Stefan Guilhen + */ +public class JBossSTSConfiguration implements STSConfiguration +{ + + // the delegate contains all the information extracted from the jboss-s= ts.xml configuration file. + private final JBossSTSConfig delegate; + + private final Map tokenProviders =3D new= HashMap(); + + private final Map spMetadata =3D new HashMap(); + + private final Map options =3D new HashMap(); + + /** + * = + */ + public JBossSTSConfiguration() + { + this.delegate =3D 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.w= strust.StandardRequestHandler"); + } + + /** + * = + * @param config + */ + public JBossSTSConfiguration(JBossSTSConfig config) + { + this.delegate =3D config; + // set the default request handler if one hasn't been specified. + if(this.delegate.getRequestHandler() =3D=3D null) + this.delegate.setRequestHandler("org.jboss.identity.federation.ap= i.wstrust.StandardRequestHandler"); + + // build the token-provider and service-metadata maps. + TokenProviders providers =3D this.delegate.getTokenProviders(); + if (providers !=3D null) + { + for (TokenProvider provider : providers.getTokenProvider()) + { + try + { + SecurityTokenProvider tokenProvider =3D (SecurityTokenProvi= der) SecurityActions.instantiateClass(provider + .getProviderClass()); + this.tokenProviders.put(provider.getTokenType(), tokenProvi= der); + } + catch (PrivilegedActionException pae) + { + throw new RuntimeException("Unable to instantiate token pro= vider " + provider.getProviderClass(), pae); + } + } + } + ServiceProviders serviceProviders =3D this.delegate.getServiceProvid= ers(); + if(serviceProviders !=3D null) + { + for (ServiceProvider provider : serviceProviders.getServiceProvid= er()) + this.spMetadata.put(provider.getEndpoint(), provider); + } + } + + /* + * (non-Javadoc) + * = + * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getS= TSName() + */ + public String getSTSName() + { + return this.delegate.getSTSName(); + } + + /* + * (non-Javadoc) + * = + * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getE= ncryptIssuedToken() + */ + public boolean getEncryptIssuedToken() + { + return this.delegate.isEncryptToken(); + } + + /* + * (non-Javadoc) + * = + * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getI= ssuedTokenTimeout() + */ + public long getIssuedTokenTimeout() + { + return this.delegate.getTokenTimeout(); + } + + /* + * (non-Javadoc) + * = + * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getR= equestHandlerClass() + */ + public String getRequestHandlerClass() + { + return this.delegate.getRequestHandler(); + } + + /* + * (non-Javadoc) + * = + * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getO= ptions() + */ + public Map getOptions() + { + return this.options; + } + + /* + * (non-Javadoc) + * = + * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getP= roviderForService(java.lang.String) + */ + public SecurityTokenProvider getProviderForService(String serviceName) + { + ServiceProvider provider =3D this.spMetadata.get(serviceName); + if (provider !=3D null) + { + return this.tokenProviders.get(provider.getTokenType()); + } + return null; + } + + /* + * (non-Javadoc) + * = + * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getP= roviderForTokenType(java.lang.String) + */ + public SecurityTokenProvider getProviderForTokenType(String tokenType) + { + return this.tokenProviders.get(tokenType); + } + + /* + * (non-Javadoc) + * = + * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getT= okenTypeForService(java.lang.String) + */ + public String getTokenTypeForService(String serviceName) + { + ServiceProvider provider =3D this.spMetadata.get(serviceName); + if (provider !=3D null) + return provider.getTokenType(); + return null; + } + +} Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/= identity/federation/bindings/jboss/trust/SecurityActions.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/jboss/trust/SecurityActions.java = (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/ide= ntity/federation/bindings/jboss/trust/SecurityActions.java 2009-03-27 14:46= :49 UTC (rev 406) @@ -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.bindings.jboss.trust; + +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + +/** + * = + *

+ *

+ * = + * @author Stefan Guilhen + */ +class SecurityActions +{ + + /** + * = + * @return + */ + static ClassLoader getContextClassLoader() + { + return AccessController.doPrivileged(new PrivilegedAction() + { + public ClassLoader run() + { + return Thread.currentThread().getContextClassLoader(); + } + }); + } + + /** + * = + * @param name + * @return + * @throws PrivilegedActionException + */ + static Class loadClass(final String name) throws PrivilegedActionExc= eption + { + return AccessController.doPrivileged(new PrivilegedExceptionAction>() + { + 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 Privilege= dActionException + { + return AccessController.doPrivileged(new PrivilegedExceptionAction() + { + public Object run() throws Exception + { + Class objectClass =3D loadClass(className); + return objectClass.newInstance(); + } + }); + } +} \ No newline at end of file Added: identity-federation/trunk/identity-bindings/src/main/resources/schem= a/config/jboss-sts.xsd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-bindings/src/main/resources/schema/c= onfig/jboss-sts.xsd (rev 0) +++ identity-federation/trunk/identity-bindings/src/main/resources/schema/c= onfig/jboss-sts.xsd 2009-03-27 14:46:49 UTC (rev 406) @@ -0,0 +1,122 @@ + + + = + + + + + + + + + + + + + = + + = + = + + + + + + + + + + + + + + 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. + + + + + + = + + + + + + + The Truststore type contains information about the truststore that ho= lds the service providers + PKCs (public key certificates). When tokens need to be encrypted, the= service provider's PKC + is used to perform the encryption. = + + + + + = + + + + + + + + + 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). + + + + + + + + = + + + + + + + + + = + + + + + + + + + The service providers specify the token type expected by each service= provider. + + + + + + + + + + + + + The service provider type contains information about a specific servi= ce provider. In particular, + it specifies the type of the token that must be issued for the provid= er and the alias of the + provider's PKC in the truststore. This is used by the STS to locate t= he PKC when encrypting the + generated token. = + + + + + + + + + + = + + \ No newline at end of file Deleted: identity-federation/trunk/identity-fed-api/src/main/java/org/jboss= /identity/federation/api/wstrust/StandardSTSConfiguration.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/iden= tity/federation/api/wstrust/StandardSTSConfiguration.java 2009-03-27 13:12:= 48 UTC (rev 405) +++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/iden= tity/federation/api/wstrust/StandardSTSConfiguration.java 2009-03-27 14:46:= 49 UTC (rev 406) @@ -1,190 +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.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; - -/** - *

- *

- * = - * @author Stefan Guilhen - */ -public class StandardSTSConfiguration implements STSConfiguration -{ - - // the delegate contains all the information extracted from the jboss-s= ts.xml configuration file. - private final JBossSTSConfig delegate; - - private final Map tokenProviders =3D new= HashMap(); - - private final Map spMetadata =3D new HashMap(); - - private final Map options =3D new HashMap(); - - /** - * = - */ - public StandardSTSConfiguration() - { - this.delegate =3D 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.w= strust.StandardRequestHandler"); - } - - /** - * = - * @param config - */ - public StandardSTSConfiguration(JBossSTSConfig config) - { - this.delegate =3D config; - // set the default request handler if one hasn't been specified. - if(this.delegate.getRequestHandler() =3D=3D null) - this.delegate.setRequestHandler("org.jboss.identity.federation.ap= i.wstrust.StandardRequestHandler"); - - // build the token-provider and service-metadata maps. - TokenProviders providers =3D this.delegate.getTokenProviders(); - if (providers !=3D null) - { - for (TokenProvider provider : providers.getTokenProvider()) - { - try - { - SecurityTokenProvider tokenProvider =3D (SecurityTokenProvi= der) SecurityActions.instantiateClass(provider - .getProviderClass()); - this.tokenProviders.put(provider.getTokenType(), tokenProvi= der); - } - catch (PrivilegedActionException pae) - { - throw new RuntimeException("Unable to instantiate token pro= vider " + provider.getProviderClass(), pae); - } - } - } - ServiceProviders serviceProviders =3D this.delegate.getServiceProvid= ers(); - if(serviceProviders !=3D null) - { - for (ServiceProvider provider : serviceProviders.getServiceProvid= er()) - this.spMetadata.put(provider.getEndpoint(), provider); - } - } - - /* - * (non-Javadoc) - * = - * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getS= TSName() - */ - public String getSTSName() - { - return this.delegate.getSTSName(); - } - - /* - * (non-Javadoc) - * = - * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getE= ncryptIssuedToken() - */ - public boolean getEncryptIssuedToken() - { - return this.delegate.isEncryptToken(); - } - - /* - * (non-Javadoc) - * = - * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getI= ssuedTokenTimeout() - */ - public long getIssuedTokenTimeout() - { - return this.delegate.getTokenTimeout(); - } - - /* - * (non-Javadoc) - * = - * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getR= equestHandlerClass() - */ - public String getRequestHandlerClass() - { - return this.delegate.getRequestHandler(); - } - - /* - * (non-Javadoc) - * = - * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getO= ptions() - */ - public Map getOptions() - { - return this.options; - } - - /* - * (non-Javadoc) - * = - * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getP= roviderForService(java.lang.String) - */ - public SecurityTokenProvider getProviderForService(String serviceName) - { - ServiceProvider provider =3D this.spMetadata.get(serviceName); - if (provider !=3D null) - { - return this.tokenProviders.get(provider.getTokenType()); - } - return null; - } - - /* - * (non-Javadoc) - * = - * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getP= roviderForTokenType(java.lang.String) - */ - public SecurityTokenProvider getProviderForTokenType(String tokenType) - { - return this.tokenProviders.get(tokenType); - } - - /* - * (non-Javadoc) - * = - * @see org.jboss.identity.federation.api.wstrust.STSConfiguration#getT= okenTypeForService(java.lang.String) - */ - public String getTokenTypeForService(String serviceName) - { - ServiceProvider provider =3D this.spMetadata.get(serviceName); - if (provider !=3D null) - return provider.getTokenType(); - return null; - } - -} Modified: identity-federation/trunk/identity-fed-api/src/main/java/org/jbos= s/identity/federation/api/wstrust/WSTrustJAXBFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/iden= tity/federation/api/wstrust/WSTrustJAXBFactory.java 2009-03-27 13:12:48 UTC= (rev 405) +++ identity-federation/trunk/identity-fed-api/src/main/java/org/jboss/iden= tity/federation/api/wstrust/WSTrustJAXBFactory.java 2009-03-27 14:46:49 UTC= (rev 406) @@ -21,9 +21,6 @@ */ 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; @@ -43,7 +40,6 @@ import org.jboss.identity.federation.ws.trust.RequestSecurityTokenResponse= CollectionType; import org.jboss.identity.federation.ws.trust.RequestSecurityTokenResponse= Type; import org.jboss.identity.federation.ws.trust.RequestSecurityTokenType; -import org.jboss.identity.federation.ws.trust.config.JBossSTSConfig; = /** *

@@ -239,28 +235,4 @@ } } = - /** - * = - * @param configurationFile - * @return - */ - public STSConfiguration parseConfiguration(URL configurationFile) - { - if (configurationFile =3D=3D null) - return new StandardSTSConfiguration(); - - try - { - InputStream stream =3D configurationFile.openStream(); - JAXBContext context =3D JAXBContext.newInstance("org.jboss.identi= ty.federation.ws.trust.config"); - Unmarshaller unmarshaller =3D context.createUnmarshaller(); - JBossSTSConfig jbossConfig =3D (JBossSTSConfig) unmarshaller.unma= rshal(stream); - return new StandardSTSConfiguration(jbossConfig); - } - catch (Exception e) - { - throw new RuntimeException("Error parsing the configuration file"= , e); - } - } - } Deleted: identity-federation/trunk/identity-fed-model/src/main/resources/sc= hema/wstrust/v1_3/jboss-sts.xsd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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) +++ identity-federation/trunk/identity-fed-model/src/main/resources/schema/= wstrust/v1_3/jboss-sts.xsd 2009-03-27 14:46:49 UTC (rev 406) @@ -1,122 +0,0 @@ - - - = - - - - - - - - - - - - - = - - = - = - - - - - - - - - - - - - - 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. - - - - - - = - - - - - - - The Truststore type contains information about the truststore that ho= lds the service providers - PKCs (public key certificates). When tokens need to be encrypted, the= service provider's PKC - is used to perform the encryption. = - - - - - = - - - - - - - - - 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). - - - - - - - - = - - - - - - - - - = - - - - - - - - - The service providers specify the token type expected by each service= provider. - - - - - - - - - - - - - The service provider type contains information about a specific servi= ce provider. In particular, - it specifies the type of the token that must be issued for the provid= er and the alias of the - provider's PKC in the truststore. This is used by the STS to locate t= he PKC when encrypting the - generated token. = - - - - - - - - - - = - - \ No newline at end of file --===============7775021473429679562==--