cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1173182 [1/9] - in /cxf/trunk: ./ services/ services/sts/ services/sts/sts-core/ services/sts/sts-core/src/ services/sts/sts-core/src/main/ services/sts/sts-core/src/main/java/ services/sts/sts-core/src/main/java/org/ services/sts/sts-core...
Date Tue, 20 Sep 2011 15:12:11 GMT
Author: coheigea
Date: Tue Sep 20 15:12:07 2011
New Revision: 1173182

URL: http://svn.apache.org/viewvc?rev=1173182&view=rev
Log:
[CXF-3811] - Added sts-core module to a new services module.
 - System tests to follow.

Added:
    cxf/trunk/services/
    cxf/trunk/services/pom.xml
    cxf/trunk/services/sts/
    cxf/trunk/services/sts/pom.xml
    cxf/trunk/services/sts/sts-core/
    cxf/trunk/services/sts/sts-core/pom.xml
    cxf/trunk/services/sts/sts-core/src/
    cxf/trunk/services/sts/sts-core/src/main/
    cxf/trunk/services/sts/sts-core/src/main/java/
    cxf/trunk/services/sts/sts-core/src/main/java/org/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/QNameConstants.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSConstants.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSPropertiesMBean.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryCache.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryTokenStore.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/HazelCastCache.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/STSCache.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/STSTokenStore.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/Claim.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimCollection.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimTypes.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsHandler.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/RequestClaim.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/RequestClaimCollection.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/interceptor/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/interceptor/SCTInInterceptor.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/interceptor/SCTOutInterceptor.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenCancelOperation.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenValidateOperation.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/Entropy.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/KeyRequirements.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/Lifetime.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/ReceivedToken.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/TokenRequirements.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/EncryptionProperties.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/ServiceMBean.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/service/StaticService.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/TokenCanceller.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/TokenCancellerParameters.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/TokenCancellerResponse.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/AttributeStatementProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/AuthDecisionStatementProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/AuthenticationStatementProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/ConditionsProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultAttributeStatementProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultConditionsProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SamlCallbackHandler.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SubjectProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SymmetricKeyHandler.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProvider.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderParameters.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenProviderResponse.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/TokenReference.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/TokenValidator.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/TokenValidatorParameters.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/TokenValidatorResponse.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
    cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/X509TokenValidator.java
    cxf/trunk/services/sts/sts-core/src/test/
    cxf/trunk/services/sts/sts-core/src/test/java/
    cxf/trunk/services/sts/sts-core/src/test/java/org/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/DefaultInMemoryCacheTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/DefaultInMemoryTokenStoreTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/cache/HazelCastCacheTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomAttributeProvider.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimsHandler.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/PasswordCallbackHandler.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/ldap/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/ldap/LDAPClaimsTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/CancelSCTUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/DummyTokenProvider.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/DummyTokenValidator.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueEncryptedUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSCTUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlClaimsUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueSamlUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateSCTUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateSamlUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateTokenTransformationUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUsernameTokenUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/request/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/request/RequestParserUnitTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/canceller/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/canceller/SCTCancellerTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/CustomAuthDecisionProvider.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/CustomAuthenticationProvider.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/CustomSubjectProvider.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLClaimsTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderActAsTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderCustomTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderKeyTypeTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SAMLProviderOnBehalfOfTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/SCTProviderTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SAMLTokenValidatorTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/SCTValidatorTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/UsernameTokenValidatorTest.java
    cxf/trunk/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/validator/X509TokenValidatorTest.java
    cxf/trunk/services/sts/sts-core/src/test/resources/
    cxf/trunk/services/sts/sts-core/src/test/resources/eve.jks
    cxf/trunk/services/sts/sts-core/src/test/resources/ldap.properties
    cxf/trunk/services/sts/sts-core/src/test/resources/ldap.xml
    cxf/trunk/services/sts/sts-core/src/test/resources/logging.properties
    cxf/trunk/services/sts/sts-core/src/test/resources/stsstore.jks
    cxf/trunk/services/sts/sts-core/src/test/resources/x509.p12
Modified:
    cxf/trunk/pom.xml

Modified: cxf/trunk/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/pom.xml?rev=1173182&r1=1173181&r2=1173182&view=diff
==============================================================================
--- cxf/trunk/pom.xml (original)
+++ cxf/trunk/pom.xml Tue Sep 20 15:12:07 2011
@@ -180,6 +180,7 @@
         <module>integration</module>
         <module>maven-plugins</module>
 	<!--module>test-samples</module-->
+        <module>services</module>
         <module>systests</module>
     </modules>
 

Added: cxf/trunk/services/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/pom.xml?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/pom.xml (added)
+++ cxf/trunk/services/pom.xml Tue Sep 20 15:12:07 2011
@@ -0,0 +1,38 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf</groupId>
+    <artifactId>cxf-services</artifactId>
+    <packaging>pom</packaging>
+    <version>2.5.0-SNAPSHOT</version>
+    <name>Apache CXF Runtime</name>
+    <url>http://cxf.apache.org</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf</artifactId>
+        <version>2.5.0-SNAPSHOT</version>
+    </parent>
+
+    <modules>
+        <module>sts</module>
+    </modules>
+
+</project>

Added: cxf/trunk/services/sts/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/pom.xml?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/pom.xml (added)
+++ cxf/trunk/services/sts/pom.xml Tue Sep 20 15:12:07 2011
@@ -0,0 +1,38 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf</groupId>
+    <artifactId>cxf-services-sts</artifactId>
+    <packaging>pom</packaging>
+    <version>2.5.0-SNAPSHOT</version>
+    <name>Apache CXF STS service</name>
+    <url>http://cxf.apache.org</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf</artifactId>
+        <version>2.5.0-SNAPSHOT</version>
+    </parent>
+
+    <modules>
+        <module>sts-core</module>
+    </modules>
+
+</project>

Added: cxf/trunk/services/sts/sts-core/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/pom.xml?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/pom.xml (added)
+++ cxf/trunk/services/sts/sts-core/pom.xml Tue Sep 20 15:12:07 2011
@@ -0,0 +1,136 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>cxf-services-sts-core</artifactId>
+    <packaging>jar</packaging>
+    <name>Apache CXF STS core</name>
+    <url>http://cxf.apache.org</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-parent</artifactId>
+        <version>2.5.0-SNAPSHOT</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-ws-security</artifactId>
+            <version>${project.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-ws-addr</artifactId>
+            <version>${project.version}</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>net.sf.ehcache</groupId>
+            <artifactId>ehcache-core</artifactId>
+            <version>2.4.4</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+           <groupId>org.springframework.ldap</groupId>
+           <artifactId>spring-ldap-core</artifactId>
+           <version>1.3.1.RELEASE</version>
+           <scope>compile</scope>
+        </dependency>
+        <dependency>
+           <groupId>com.hazelcast</groupId>
+           <artifactId>hazelcast</artifactId>
+           <version>1.9.4</version>
+           <scope>compile</scope>
+        </dependency> 
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jdk14</artifactId>
+            <scope>test</scope>
+        </dependency>
+   </dependencies>
+
+   <build>
+        <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
+        <testResources>
+            <testResource>
+                <directory>src/test/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </testResource>
+            <testResource>
+                <directory>src/test/resources</directory>
+                <includes>
+                    <include>**/*</include>
+                </includes>
+            </testResource>
+        </testResources>
+        
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <version>2.6</version>
+                <configuration>
+                    <reportFormat>brief</reportFormat>
+                    <useFile>false</useFile>
+                    <forkMode>always</forkMode>
+                    <childDelegation>false</childDelegation>
+                    <includes>
+                        <include>**/*Test.java</include>
+                    </includes>
+                    <systemPropertyVariables>
+		        <java.util.logging.config.file>${basedir}/src/test/resources/logging.properties</java.util.logging.config.file>
+                    </systemPropertyVariables>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>2.1.2</version>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <phase>verify</phase>
+                        <goals>
+                            <goal>jar-no-fork</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    
+</project>
+ 

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/QNameConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/QNameConstants.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/QNameConstants.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/QNameConstants.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,109 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sts;
+
+import javax.xml.namespace.QName;
+
+/**
+ * This class holds a collection of QName constants.
+ */
+public final class QNameConstants {
+    
+    public static final org.apache.cxf.ws.security.sts.provider.model.ObjectFactory WS_TRUST_FACTORY 
+        = new org.apache.cxf.ws.security.sts.provider.model.ObjectFactory();
+    public static final org.apache.cxf.ws.security.sts.provider.model.wstrust14.ObjectFactory 
+    WS_TRUST14_FACTORY = new org.apache.cxf.ws.security.sts.provider.model.wstrust14.ObjectFactory();
+    public static final org.apache.cxf.ws.security.sts.provider.model.secext.ObjectFactory WSSE_FACTORY 
+        = new org.apache.cxf.ws.security.sts.provider.model.secext.ObjectFactory();
+    public static final org.apache.cxf.ws.security.sts.provider.model.utility.ObjectFactory UTIL_FACTORY
+        = new org.apache.cxf.ws.security.sts.provider.model.utility.ObjectFactory();
+    
+    //
+    // Token Requirement QNames
+    //
+    public static final QName TOKEN_TYPE = 
+        WS_TRUST_FACTORY.createTokenType("").getName();
+    public static final QName ENTROPY = 
+        WS_TRUST_FACTORY.createEntropy(null).getName();
+    public static final QName BINARY_SECRET = 
+        WS_TRUST_FACTORY.createBinarySecret(null).getName();
+    public static final QName ON_BEHALF_OF = 
+        WS_TRUST_FACTORY.createOnBehalfOf(null).getName();
+    public static final QName VALIDATE_TARGET = 
+        WS_TRUST_FACTORY.createValidateTarget(null).getName();
+    public static final QName CANCEL_TARGET =
+        WS_TRUST_FACTORY.createCancelTarget(null).getName();
+    public static final QName LIFETIME = 
+        WS_TRUST_FACTORY.createLifetime(null).getName();
+    public static final QName REQUEST_TYPE = 
+        WS_TRUST_FACTORY.createRequestType("").getName();
+    public static final QName CLAIMS = 
+        WS_TRUST_FACTORY.createClaims(null).getName();
+    
+    //
+    // Key Requirement QNames
+    //
+    public static final QName AUTHENTICATION_TYPE = 
+        WS_TRUST_FACTORY.createAuthenticationType("").getName();
+    public static final QName KEY_TYPE = 
+        WS_TRUST_FACTORY.createKeyType("").getName();
+    public static final QName KEY_SIZE = 
+        WS_TRUST_FACTORY.createKeySize(0L).getName();
+    public static final QName SIGNATURE_ALGORITHM = 
+        WS_TRUST_FACTORY.createSignatureAlgorithm("").getName();
+    public static final QName ENCRYPTION_ALGORITHM = 
+        WS_TRUST_FACTORY.createEncryptionAlgorithm("").getName();
+    public static final QName C14N_ALGORITHM = 
+        WS_TRUST_FACTORY.createCanonicalizationAlgorithm("").getName();
+    public static final QName COMPUTED_KEY_ALGORITHM = 
+        WS_TRUST_FACTORY.createComputedKeyAlgorithm("").getName();
+    public static final QName KEYWRAP_ALGORITHM = 
+        WS_TRUST_FACTORY.createKeyWrapAlgorithm("").getName();
+    public static final QName USE_KEY = 
+        WS_TRUST_FACTORY.createUseKey(null).getName();
+    
+    //
+    // WSSE QNames
+    //
+    public static final QName USERNAME_TOKEN = 
+        WSSE_FACTORY.createUsernameToken(null).getName();
+    public static final QName BINARY_SECURITY_TOKEN = 
+        WSSE_FACTORY.createBinarySecurityToken(null).getName();
+    public static final QName PASSWORD = 
+        QNameConstants.WSSE_FACTORY.createPassword(null).getName();
+    public static final QName NONCE = 
+        QNameConstants.WSSE_FACTORY.createNonce(null).getName();
+    public static final QName SECURITY_TOKEN_REFERENCE = 
+        WSSE_FACTORY.createSecurityTokenReference(null).getName();
+    public static final QName SECURITY = 
+        QNameConstants.WSSE_FACTORY.createSecurity(null).getName();
+    
+    
+    //
+    // WSTrust 1.4 QNames
+    //
+    public static final QName ACT_AS = 
+        WS_TRUST14_FACTORY.createActAs(null).getName();
+
+    private QNameConstants() {
+        //
+    }
+    
+}

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSConstants.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSConstants.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSConstants.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,131 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sts;
+
+public final class STSConstants {
+    
+    /**
+     * WS-Trust 1.3 namespace
+     */
+    public static final String WST_NS_05_12 = "http://docs.oasis-open.org/ws-sx/ws-trust/200512";
+    
+    /**
+     * WS-Trust 1.4 namespace
+     */
+    public static final String WST_NS_08_02 = "http://docs.oasis-open.org/ws-sx/ws-trust/200802";
+    
+    /**
+     * Identity namespace
+     */
+    public static final String IDT_NS_05_05 = "http://schemas.xmlsoap.org/ws/2005/05/identity";
+    
+    /**
+     * WS-Security extension namespace
+     */
+    public static final String WSSE_EXT_04_01 = 
+        "http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
+    
+    /**
+     * WS-Security utility namespace
+     */
+    public static final String WS_UTIL_03_06 = "http://schemas.xmlsoap.org/ws/2003/06/utility";
+    
+    /**
+     * Asymmetric key type (attribute of BinarySecret)
+     */
+    public static final String ASYMMETRIC_KEY_TYPE = WST_NS_05_12 + "/AsymmetricKey";
+    
+    /**
+     * Symmetric key type (attribute of BinarySecret)
+     */
+    public static final String SYMMETRIC_KEY_TYPE = WST_NS_05_12 + "/SymmetricKey";
+    
+    /**
+     * Nonce key type (attribute of BinarySecret)
+     */
+    public static final String NONCE_TYPE = WST_NS_05_12 + "/Nonce";
+    
+    /**
+     * WS-Policy namespace
+     */
+    public static final String WSP_NS = "http://www.w3.org/ns/ws-policy";
+    
+    /**
+     * WS-Policy 2004 namespace
+     */
+    public static final String WSP_NS_04 = "http://schemas.xmlsoap.org/ws/2004/09/policy";
+    
+    /**
+     * WS-Addressing 2005 namespace
+     */
+    public static final String WSA_NS_05 = "http://www.w3.org/2005/08/addressing";
+    
+    /**
+     * Symmetric key (KeyType value)
+     */
+    public static final String SYMMETRIC_KEY_KEYTYPE = WST_NS_05_12 + "/SymmetricKey";
+    
+    /**
+     * Public key (KeyType value)
+     */
+    public static final String PUBLIC_KEY_KEYTYPE = WST_NS_05_12 + "/PublicKey";
+    
+    /**
+     * Bearer key (KeyType value)
+     */
+    public static final String BEARER_KEY_KEYTYPE = WST_NS_05_12 + "/Bearer";
+    
+    /**
+     * ComputedKey P-SHA1 URI
+     */
+    public static final String COMPUTED_KEY_PSHA1 = WST_NS_05_12 + "/CK/PSHA1";
+    
+    /**
+     * Status TokenType
+     */
+    public static final String STATUS = WST_NS_05_12 + "/RSTR/Status";
+    
+    /**
+     * Valid Status Code
+     */
+    public static final String VALID_CODE = WST_NS_05_12 + "/status/valid";
+    
+    /**
+     * Invalid Status Code
+     */
+    public static final String INVALID_CODE = WST_NS_05_12 + "/status/invalid";
+    
+    /**
+     * Valid Status Reason
+     */
+    public static final String VALID_REASON = 
+        "The Trust service successfully validated the input";
+    
+    /**
+     * Invalid Status Reason
+     */
+    public static final String INVALID_REASON = 
+        "The Trust service did not successfully validate the input";
+    
+    private STSConstants() {
+        // complete
+    }
+    
+}
\ No newline at end of file

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSPropertiesMBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSPropertiesMBean.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSPropertiesMBean.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/STSPropertiesMBean.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,126 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sts;
+
+import javax.security.auth.callback.CallbackHandler;
+
+import org.apache.cxf.ws.security.sts.provider.STSException;
+import org.apache.ws.security.components.crypto.Crypto;
+
+/**
+ * This MBean represents the properties associated with the STS. It contains a single operation
+ * "loadProperties()" which allows subclasses to perform any custom loading/processing of the 
+ * properties.
+ */
+public interface STSPropertiesMBean {
+    
+    /**
+     * Load/process the CallbackHandler, Crypto objects, etc.
+     */
+    void configureProperties() throws STSException;
+
+    /**
+     * Set the CallbackHandler object. 
+     * @param callbackHandler the CallbackHandler object. 
+     */
+    void setCallbackHandler(CallbackHandler callbackHandler);
+    
+    /**
+     * Get the CallbackHandler object.
+     * @return the CallbackHandler object.
+     */
+    CallbackHandler getCallbackHandler();
+    
+    /**
+     * Set the signature Crypto object
+     * @param signatureCrypto the signature Crypto object
+     */
+    void setSignatureCrypto(Crypto signatureCrypto);
+    
+    /**
+     * Get the signature Crypto object
+     * @return the signature Crypto object
+     */
+    Crypto getSignatureCrypto();
+    
+    /**
+     * Set the username/alias to use to sign any issued tokens
+     * @param signatureUsername the username/alias to use to sign any issued tokens
+     */
+    void setSignatureUsername(String signatureUsername);
+    
+    /**
+     * Get the username/alias to use to sign any issued tokens
+     * @return the username/alias to use to sign any issued tokens
+     */
+    String getSignatureUsername();
+    
+    /**
+     * Set the encryption Crypto object
+     * @param encryptionCrypto the encryption Crypto object
+     */
+    void setEncryptionCrypto(Crypto encryptionCrypto);
+    
+    /**
+     * Get the encryption Crypto object
+     * @return the encryption Crypto object
+     */
+    Crypto getEncryptionCrypto();
+    
+    /**
+     * Set the username/alias to use to encrypt any issued tokens. This is a default value - it
+     * can be configured per Service in the ServiceMBean.
+     * @param encryptionUsername the username/alias to use to encrypt any issued tokens
+     */
+    void setEncryptionUsername(String encryptionUsername);
+    
+    /**
+     * Get the username/alias to use to encrypt any issued tokens. This is a default value - it
+     * can be configured per Service in the ServiceMBean
+     * @return the username/alias to use to encrypt any issued tokens
+     */
+    String getEncryptionUsername();
+    
+    /**
+     * Set the STS issuer name
+     * @param issuer the STS issuer name
+     */
+    void setIssuer(String issuer);
+    
+    /**
+     * Get the STS issuer name
+     * @return the STS issuer name
+     */
+    String getIssuer();
+    
+    /**
+     * Set the SignatureProperties to use.
+     * @param signatureProperties the SignatureProperties to use.
+     */
+    void setSignatureProperties(SignatureProperties signatureProperties);
+    
+    /**
+     * Get the SignatureProperties to use.
+     * @return the SignatureProperties to use.
+     */
+    SignatureProperties getSignatureProperties();
+    
+    
+}

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/SignatureProperties.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,94 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.sts;
+
+/**
+ * This class contains various configuration properties that can be used to sign an issued token.
+ */
+public class SignatureProperties {
+    private boolean useKeyValue;
+    private long keySize = 256;
+    private long minimumKeySize = 128;
+    private long maximumKeySize = 512;
+    
+    /**
+     * Get whether a KeyValue is used to refer to a a certificate used to sign an issued token. 
+     * The default is false.
+     */
+    public boolean isUseKeyValue() {
+        return useKeyValue;
+    }
+
+    /**
+     * Set whether a KeyValue is used to refer to a a certificate used to sign an issued token. 
+     * The default is false.
+     */
+    public void setUseKeyValue(boolean useKeyValue) {
+        this.useKeyValue = useKeyValue;
+    }
+
+    /**
+     * Get the key size to use when generating a symmetric key to sign an issued token. The default is
+     * 256 bits.
+     */
+    public long getKeySize() {
+        return keySize;
+    }
+
+    /**
+     * Set the key size to use when generating a symmetric key to sign an issued token. The default is
+     * 256 bits.
+     */
+    public void setKeySize(long keySize) {
+        this.keySize = keySize;
+    }
+    
+    /**
+     * Get the minimum key size to use when generating a symmetric key to sign an issued token. The
+     * requestor can specify a KeySize value to use. The default is 128 bits.
+     */
+    public long getMinimumKeySize() {
+        return minimumKeySize;
+    }
+
+    /**
+     * Set the minimum key size to use when generating a symmetric key to sign an issued token. The
+     * requestor can specify a KeySize value to use. The default is 128 bits.
+     */
+    public void setMinimumKeySize(long minimumKeySize) {
+        this.minimumKeySize = minimumKeySize;
+    }
+
+    /**
+     * Get the maximum key size to use when generating a symmetric key to sign an issued token. The
+     * requestor can specify a KeySize value to use. The default is 512 bits.
+     */
+    public long getMaximumKeySize() {
+        return maximumKeySize;
+    }
+
+    /**
+     * Set the maximum key size to use when generating a symmetric key to sign an issued token. The
+     * requestor can specify a KeySize value to use. The default is 512 bits.
+     */
+    public void setMaximumKeySize(long maximumKeySize) {
+        this.maximumKeySize = maximumKeySize;
+    }
+    
+}
\ No newline at end of file

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,302 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.sts;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Properties;
+import java.util.logging.Logger;
+
+import javax.security.auth.callback.CallbackHandler;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.phase.PhaseInterceptorChain;
+import org.apache.cxf.resource.ResourceManager;
+import org.apache.cxf.ws.security.sts.provider.STSException;
+import org.apache.ws.security.WSSConfig;
+import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.components.crypto.Crypto;
+import org.apache.ws.security.components.crypto.CryptoFactory;
+
+/**
+ * A static implementation of the STSPropertiesMBean.
+ */
+public class StaticSTSProperties implements STSPropertiesMBean {
+    
+    private static final Logger LOG = LogUtils.getL7dLogger(StaticSTSProperties.class);
+    
+    private CallbackHandler callbackHandler;
+    private String callbackHandlerClass;
+    private Crypto signatureCrypto;
+    private String signaturePropertiesFile;
+    private String signatureUsername;
+    private Crypto encryptionCrypto;
+    private String encryptionPropertiesFile;
+    private String encryptionUsername;
+    private String issuer;
+    private SignatureProperties signatureProperties = new SignatureProperties();
+
+    /**
+     * Load the CallbackHandler, Crypto objects, if necessary.
+     */
+    public void configureProperties() throws STSException {
+        if (signatureCrypto == null && signaturePropertiesFile != null) {
+            Properties sigProperties = getProps(signaturePropertiesFile);
+            if (sigProperties == null) {
+                LOG.fine("Cannot load signature properties using: " + signaturePropertiesFile);
+                throw new STSException("Configuration error: cannot load signature properties");
+            }
+            try {
+                signatureCrypto = CryptoFactory.getInstance(sigProperties);
+            } catch (WSSecurityException ex) {
+                LOG.fine("Error in loading the signature Crypto object: " + ex.getMessage());
+                throw new STSException(ex.getMessage());
+            }
+        }
+        
+        if (encryptionCrypto == null && encryptionPropertiesFile != null) {
+            Properties encrProperties = getProps(encryptionPropertiesFile);
+            if (encrProperties == null) {
+                LOG.fine("Cannot load encryption properties using: " + encryptionPropertiesFile);
+                throw new STSException("Configuration error: cannot load encryption properties");
+            }
+            try {
+                encryptionCrypto = CryptoFactory.getInstance(encrProperties);
+            } catch (WSSecurityException ex) {
+                LOG.fine("Error in loading the encryption Crypto object: " + ex.getMessage());
+                throw new STSException(ex.getMessage());
+            }
+        }
+        
+        if (callbackHandler == null && callbackHandlerClass != null) {
+            callbackHandler = getCallbackHandler(callbackHandlerClass);
+            if (callbackHandler == null) {
+                LOG.fine("Cannot load CallbackHandler using: " + callbackHandlerClass);
+                throw new STSException("Configuration error: cannot load callback handler");
+            }
+        }
+        WSSConfig.init();
+    }
+
+    /**
+     * Set the CallbackHandler object. 
+     * @param callbackHandler the CallbackHandler object. 
+     */
+    public void setCallbackHandler(CallbackHandler callbackHandler) {
+        this.callbackHandler = callbackHandler;
+        LOG.fine("Setting callbackHandler: " + callbackHandler);
+    }
+    
+    /**
+     * Set the String corresponding to the CallbackHandler class. 
+     * @param callbackHandlerClass the String corresponding to the CallbackHandler class. 
+     */
+    public void setCallbackHandlerClass(String callbackHandlerClass) {
+        this.callbackHandlerClass = callbackHandlerClass;
+        LOG.fine("Setting callbackHandlerClass: " + callbackHandlerClass);
+    }
+    
+    /**
+     * Get the CallbackHandler object.
+     * @return the CallbackHandler object.
+     */
+    public CallbackHandler getCallbackHandler() {
+        return callbackHandler;
+    }
+    
+    /**
+     * Set the signature Crypto object
+     * @param signatureCrypto the signature Crypto object
+     */
+    public void setSignatureCrypto(Crypto signatureCrypto) {
+        this.signatureCrypto = signatureCrypto;
+    }
+    
+    /**
+     * Set the String corresponding to the signature Properties class
+     * @param signaturePropertiesFile the String corresponding to the signature properties file
+     */
+    public void setSignaturePropertiesFile(String signaturePropertiesFile) {
+        this.signaturePropertiesFile = signaturePropertiesFile;
+        LOG.fine("Setting signature properties: " + signaturePropertiesFile);
+    }
+    
+    /**
+     * Get the signature Crypto object
+     * @return the signature Crypto object
+     */
+    public Crypto getSignatureCrypto() {
+        return signatureCrypto;
+    }
+    
+    /**
+     * Set the username/alias to use to sign any issued tokens
+     * @param signatureUsername the username/alias to use to sign any issued tokens
+     */
+    public void setSignatureUsername(String signatureUsername) {
+        this.signatureUsername = signatureUsername;
+        LOG.fine("Setting signatureUsername: " + signatureUsername);
+    }
+    
+    /**
+     * Get the username/alias to use to sign any issued tokens
+     * @return the username/alias to use to sign any issued tokens
+     */
+    public String getSignatureUsername() {
+        return signatureUsername;
+    }
+    
+    /**
+     * Set the encryption Crypto object
+     * @param encryptionCrypto the encryption Crypto object
+     */
+    public void setEncryptionCrypto(Crypto encryptionCrypto) {
+        this.encryptionCrypto = encryptionCrypto;
+    }
+    
+    /**
+     * Set the String corresponding to the encryption Properties class
+     * @param signaturePropertiesFile the String corresponding to the encryption properties file
+     */
+    public void setEncryptionPropertiesFile(String encryptionPropertiesFile) {
+        this.encryptionPropertiesFile = encryptionPropertiesFile;
+        LOG.fine("Setting encryptionProperties: " + encryptionPropertiesFile);
+    }
+    
+    /**
+     * Get the encryption Crypto object
+     * @return the encryption Crypto object
+     */
+    public Crypto getEncryptionCrypto() {
+        return encryptionCrypto;
+    }
+    
+    /**
+     * Set the username/alias to use to encrypt any issued tokens. This is a default value - it
+     * can be configured per Service in the ServiceMBean.
+     * @param encryptionUsername the username/alias to use to encrypt any issued tokens
+     */
+    public void setEncryptionUsername(String encryptionUsername) {
+        this.encryptionUsername = encryptionUsername;
+        LOG.fine("Setting encryptionUsername: " + encryptionUsername);
+    }
+    
+    /**
+     * Get the username/alias to use to encrypt any issued tokens. This is a default value - it
+     * can be configured per Service in the ServiceMBean
+     * @return the username/alias to use to encrypt any issued tokens
+     */
+    public String getEncryptionUsername() {
+        return encryptionUsername;
+    }
+    
+    /**
+     * Set the STS issuer name
+     * @param issuer the STS issuer name
+     */
+    public void setIssuer(String issuer) {
+        this.issuer = issuer;
+        LOG.fine("Setting issuer: " + issuer);
+    }
+    
+    /**
+     * Get the STS issuer name
+     * @return the STS issuer name
+     */
+    public String getIssuer() {
+        return issuer;
+    }
+    
+    /**
+     * Set the SignatureProperties to use.
+     * @param signatureProperties the SignatureProperties to use.
+     */
+    public void setSignatureProperties(SignatureProperties signatureProperties) {
+        this.signatureProperties = signatureProperties;
+    }
+    
+    /**
+     * Get the SignatureProperties to use.
+     * @return the SignatureProperties to use.
+     */
+    public SignatureProperties getSignatureProperties() {
+        return signatureProperties;
+    }
+    
+    private static Properties getProps(Object o) {
+        Properties properties = null;
+        if (o instanceof Properties) {
+            properties = (Properties)o;
+        } else if (o instanceof String) {
+            URL url = null;
+            Bus bus = PhaseInterceptorChain.getCurrentMessage().getExchange().getBus();
+            ResourceManager rm = bus.getExtension(ResourceManager.class);
+            url = rm.resolveResource((String)o, URL.class);
+            try {
+                if (url == null) {
+                    url = ClassLoaderUtils.getResource((String)o, StaticSTSProperties.class);
+                }
+                if (url == null) {
+                    url = new URL((String)o);
+                }
+                if (url != null) {
+                    properties = new Properties();
+                    InputStream ins = url.openStream();
+                    properties.load(ins);
+                    ins.close();
+                }
+            } catch (IOException e) {
+                LOG.fine(e.getMessage());
+                properties = null;
+            }
+        } else if (o instanceof URL) {
+            properties = new Properties();
+            try {
+                InputStream ins = ((URL)o).openStream();
+                properties.load(ins);
+                ins.close();
+            } catch (IOException e) {
+                LOG.fine(e.getMessage());
+                properties = null;
+            }            
+        }
+        return properties;
+    }
+    
+    private CallbackHandler getCallbackHandler(Object o) {
+        CallbackHandler handler = null;
+        if (o instanceof CallbackHandler) {
+            handler = (CallbackHandler)o;
+        } else if (o instanceof String) {
+            try {
+                handler = 
+                    (CallbackHandler)ClassLoaderUtils.loadClass((String)o, this.getClass()).newInstance();
+            } catch (Exception e) {
+                LOG.fine(e.getMessage());
+                handler = null;
+            }
+        }
+        return handler;
+    }
+    
+    
+}

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryCache.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryCache.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryCache.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryCache.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sts.cache;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Element;
+
+public class DefaultInMemoryCache implements STSCache {
+
+    private Cache cache;
+    private CacheManager cacheManager = CacheManager.create();
+    
+    public DefaultInMemoryCache() {
+        cache = new Cache("STS", 5000, false, false, 3600, 3600);
+        cacheManager.addCache(cache);
+    }
+    
+    public Object get(Object key) {
+        Element element = cache.get(key);
+        if (element != null) {
+            return element.getObjectValue();
+        } else {
+            return element;
+        }
+    }
+
+    public void put(Object key, Object value) {
+        cache.put(new Element(key, value));
+    }
+
+    public boolean remove(Object key) {
+        return cache.remove(key);
+    }
+
+    public void removeAll() {
+        cache.removeAll();
+    }
+
+    public int size() {
+        return cache.getSize();
+    }
+
+    public void put(Object key, Object value, Integer timeToLiveSeconds) {
+        cache.put(new Element(key, value, false, timeToLiveSeconds, timeToLiveSeconds));
+    }
+
+}

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryTokenStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryTokenStore.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryTokenStore.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/DefaultInMemoryTokenStore.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,119 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sts.cache;
+
+import java.util.Collection;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Element;
+
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.ws.security.tokenstore.SecurityToken;
+import org.apache.cxf.ws.security.tokenstore.SecurityToken.State;
+
+public class DefaultInMemoryTokenStore implements STSTokenStore {
+
+    private Cache cache;
+    private CacheManager cacheManager = CacheManager.create();
+    private boolean autoRemove = true;
+    
+    public DefaultInMemoryTokenStore() {
+        cache = new Cache("STS", 5000, false, false, 3600, 3600);
+        cacheManager.addCache(cache);
+    }
+    
+    public void add(SecurityToken token) {
+        if (token != null && !StringUtils.isEmpty(token.getId())) {
+            cache.put(new Element(token.getId(), token));
+        }
+    }
+
+    public void add(SecurityToken token, Integer timeToLiveSeconds) {
+        if (token != null && !StringUtils.isEmpty(token.getId())) {
+            cache.put(new Element(token.getId(), token, false, timeToLiveSeconds, timeToLiveSeconds));
+        }
+    }
+    
+    public void update(SecurityToken token) {
+        if (autoRemove 
+            && (token.getState() == State.EXPIRED || token.getState() == State.CANCELLED)) {
+            remove(token);
+        } else {
+            add(token);
+        }
+    }
+
+    public void remove(SecurityToken token) {
+        if (token != null && !StringUtils.isEmpty(token.getId())) {
+            cache.remove(token.getId());
+        }
+    }
+
+    public Collection<String> getTokenIdentifiers() {
+        return cache.getKeys();
+    }
+
+    public Collection<SecurityToken> getExpiredTokens() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Collection<SecurityToken> getValidTokens() {
+        return cache.getAllWithLoader(cache.getKeysWithExpiryCheck(), null).values();
+    }
+
+    public Collection<SecurityToken> getRenewedTokens() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Collection<SecurityToken> getCancelledTokens() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public SecurityToken getToken(String id) {
+        Element element = cache.get(id);
+        if (element != null) {
+            return (SecurityToken)element.getObjectValue();
+        } else {
+            return null;
+        }
+    }
+
+    public SecurityToken getTokenByAssociatedHash(int hashCode) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void removeExpiredTokens() {
+        // TODO Auto-generated method stub
+    }
+
+    public void removeCancelledTokens() {
+        // TODO Auto-generated method stub
+    }
+
+    public void setAutoRemoveTokens(boolean auto) {
+        this.autoRemove = auto;
+    }
+
+}

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/HazelCastCache.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/HazelCastCache.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/HazelCastCache.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/HazelCastCache.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.sts.cache;
+
+import java.util.Map;
+
+import com.hazelcast.core.Hazelcast;
+
+public class HazelCastCache implements STSCache {
+
+    Map<Object, Object> cacheMap;
+    
+    public HazelCastCache(String mapName) {
+        cacheMap = Hazelcast.getDefaultInstance().getMap(mapName);
+    }
+    
+    public Object get(Object key) {
+        return cacheMap.get(key);
+    }
+
+    public void put(Object key, Object value) {
+        cacheMap.put(key, value);
+    }
+
+    public void put(Object key, Object value, Integer timeToLiveSeconds) {
+        cacheMap.put(key, value);      
+    }
+
+    public boolean remove(Object key) {
+        Object obj = cacheMap.remove(key);
+        if (obj == null) {
+            return false;
+        }
+        return true;
+    }
+
+    public void removeAll() {
+        cacheMap.clear();
+    }
+
+    public int size() {
+        return cacheMap.size();
+    }
+    
+}

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/STSCache.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/STSCache.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/STSCache.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/STSCache.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,64 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sts.cache;
+
+public interface STSCache {
+
+    /**
+     * Method used to retrieve cached objects 
+     * @param key the key
+     * @return the cached object
+     */
+    Object get(Object key);
+    
+    /**
+     * Method used to store objects in the cache
+     * @param key the key
+     * @param value the value
+     */
+    void put(Object key, Object value);
+    
+    /**
+     * Method used to store objects in the cache
+     * @param key the key
+     * @param value the value
+     * @param timeToLiveSeconds timeToLive for the object
+     */
+    void put(Object key, Object value, Integer timeToLiveSeconds);
+    
+    /**
+     * Method used to remove the cached object
+     * @param key the key
+     * @return result
+     */
+    boolean remove(Object key);
+    
+    /**
+     * Method used to remove all the objects from the cache.
+     */
+    void removeAll();
+    
+    /**
+     * Method used to get the current size of the cache
+     * @return size
+     */
+    int size();
+      
+}

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/STSTokenStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/STSTokenStore.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/STSTokenStore.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/cache/STSTokenStore.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sts.cache;
+
+import org.apache.cxf.ws.security.tokenstore.SecurityToken;
+import org.apache.cxf.ws.security.tokenstore.TokenStore;
+
+public interface STSTokenStore extends TokenStore {
+
+    void add(SecurityToken token, Integer timeToLiveSeconds);
+    
+}

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/Claim.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/Claim.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/Claim.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/Claim.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,85 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sts.claims;
+
+import java.net.URI;
+import java.security.Principal;
+
+/**
+ * This represents a Claim that has been processed by a ClaimsHandler instance.
+ */
+public class Claim {
+
+    private URI claimType;
+    private String issuer;
+    private String originalIssuer;
+    private Principal principal;
+    private String value;
+    private URI namespace = ClaimTypes.URI_BASE;
+
+    public URI getNamespace() {
+        return namespace;
+    }
+
+    public void setNamespace(URI namespace) {
+        this.namespace = namespace;
+    }
+
+    public String getIssuer() {
+        return issuer;
+    }
+
+    public void setIssuer(String issuer) {
+        this.issuer = issuer;
+    }
+
+    public String getOriginalIssuer() {
+        return originalIssuer;
+    }
+
+    public void setOriginalIssuer(String originalIssuer) {
+        this.originalIssuer = originalIssuer;
+    }
+
+    public URI getClaimType() {
+        return claimType;
+    }
+
+    public void setClaimType(URI claimType) {
+        this.claimType = claimType;
+    }
+
+    public Principal getPrincipal() {
+        return principal;
+    }
+
+    public void setPrincipal(Principal principal) {
+        this.principal = principal;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+}

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimCollection.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimCollection.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimCollection.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimCollection.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sts.claims;
+
+/**
+ * This holds a collection of Claims.
+ */
+public class ClaimCollection extends java.util.ArrayList<Claim> {
+
+}

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimTypes.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimTypes.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimTypes.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimTypes.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,146 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.sts.claims;
+
+import java.net.URI;
+
+public final class ClaimTypes {
+    /**
+     * The base XML namespace URI that is used by the claim types
+     * http://docs.oasis-open.org/imi/identity/v1.0/os/identity-1.0-spec-os.pdf
+     */
+    public static final URI URI_BASE = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims");
+    
+    /**
+     * (givenName in [RFC 2256]) Preferred name or first name of a Subject.
+     * According to RFC 2256: This attribute is used to hold the part of a person's name 
+     * which is not their surname nor middle name.
+     */
+    public static final URI FIRSTNAME = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname");
+    
+    /**
+     * (sn in [RFC 2256]) Surname or family name of a Subject.
+     * According to RFC 2256: This is the X.500 surname attribute which contains the family name of a person.
+     */
+    public static final URI LASTNAME = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname");    
+    
+    /**
+     * (mail in inetOrgPerson) Preferred address for the "To:" field of email
+     * to be sent to the Subject, usually of the form <user>@<domain>.
+     * According to inetOrgPerson using [RFC 1274]: This attribute type specifies
+     * an electronic mailbox attribute following the syntax specified in RFC 822.
+     */
+    public static final URI EMAILADDRESS = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress");    
+    
+    /**
+     * (street in [RFC 2256]) Street address component of a Subject‟s address information.
+     * According to RFC 2256: This attribute contains the physical address of the object
+     * to which the entry corresponds, such as an address for package delivery.
+     */
+    public static final URI STREETADDRESS = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetaddress");    
+    
+    /**
+     * (/ in [RFC 2256]) Locality component of a Subject's address information.
+     * According to RFC 2256: This attribute contains the name of a locality, such as a city, county or other
+     * geographic region.
+     */
+    public static final URI LOCALITY = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/locality"); 
+    
+    /**
+     * (st in [RFC 2256]) Abbreviation for state or province name of a Subject's address information.
+     * According to RFC 2256: “This attribute contains the full name of a state or province.
+     * The values SHOULD be coordinated on a national level and if well-known shortcuts exist.
+     */
+    public static final URI STATE_PROVINCE = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/stateorprovince");    
+
+    /**
+     * (postalCode in X.500) Postal code or zip code component of a Subject's address information.
+     * According to X.500(2001): The postal code attribute type specifies the postal code of the named 
+     * object.
+     */
+    public static final URI POSTALCODE = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/postalcode");
+    
+    /**
+     * (c in [RFC 2256]) Country of a Subject.
+     * According to RFC 2256: This attribute contains a two-letter ISO 3166 country code.
+     */
+    public static final URI COUNTRY = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country");
+    
+    /**
+     * (homePhone in inetOrgPerson) Primary or home telephone number of a Subject.
+     * According to inetOrgPerson using [RFC 1274]: This attribute type specifies a home telephone number
+     * associated with a person.
+     */
+    public static final URI HOMEPHONE = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/homephone");
+    
+    /**
+     * (telephoneNumber in X.500 Person) Secondary or work telephone number of a Subject.
+     * According to X.500(2001): This attribute type specifies an office/campus telephone number associated 
+     * with a person.
+     */
+    public static final URI OTHERPHONE = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/otherphone");    
+
+    /**
+     * (mobile in inetOrgPerson) Mobile telephone number of a Subject.
+     * According to inetOrgPerson using [RFC 1274]: This attribute type specifies a mobile telephone number 
+     * associated with a person.
+     */
+    public static final URI MOBILEPHONE = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/mobilephone");
+    
+    /**
+     * The date of birth of a Subject in a form allowed by the xs:date data type.
+     */
+    public static final URI DATEOFBIRTH = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dateofbirth");
+    
+    /**
+     * Gender of a Subject that can have any of these exact URI values
+     *   '0' (meaning unspecified), '1' (meaning Male) or '2' (meaning Female)
+     */
+    public static final URI GENDER = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/gender");
+    
+    /**
+     * A private personal identifier (PPID) that identifies the Subject to a Relying Party.
+     */
+    public static final URI PRIVATE_PERSONAL_IDENTIFIER = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier");
+    
+    /**
+     * The Web page of a Subject expressed as a URL.
+     */
+    public static final URI WEB_PAGE = 
+        URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage");
+    
+    private ClaimTypes() {
+        // complete
+    }
+}

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsAttributeStatementProvider.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,75 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.sts.claims;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+
+import org.apache.cxf.sts.token.provider.AttributeStatementProvider;
+import org.apache.cxf.sts.token.provider.TokenProviderParameters;
+import org.apache.ws.security.WSConstants;
+import org.apache.ws.security.saml.ext.bean.AttributeBean;
+import org.apache.ws.security.saml.ext.bean.AttributeStatementBean;
+
+public class ClaimsAttributeStatementProvider implements AttributeStatementProvider {
+
+    public AttributeStatementBean getStatement(TokenProviderParameters providerParameters) {
+        // Handle Claims
+        ClaimsManager claimsManager = providerParameters.getClaimsManager();
+        ClaimCollection retrievedClaims = new ClaimCollection();
+        if (claimsManager != null) {
+            retrievedClaims = 
+                claimsManager.retrieveClaimValues(
+                    providerParameters.getPrincipal(), providerParameters.getRequestedClaims()
+                );
+        }
+                
+        List<AttributeBean> attributeList = new ArrayList<AttributeBean>();
+        String tokenType = providerParameters.getTokenRequirements().getTokenType();
+        
+        Iterator<Claim> claimIterator = retrievedClaims.iterator();
+        if (!claimIterator.hasNext()) {
+            return null;
+        }
+        
+        AttributeStatementBean attrBean = new AttributeStatementBean();
+        while (claimIterator.hasNext()) {
+            Claim claim = claimIterator.next();
+            AttributeBean attributeBean = new AttributeBean();
+            if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType)
+                || WSConstants.SAML2_NS.equals(tokenType)) {
+                attributeBean.setQualifiedName(claim.getClaimType().toString());
+                attributeBean.setNameFormat(claim.getNamespace().toString());
+            } else {
+                attributeBean.setSimpleName(claim.getClaimType().toString());
+                attributeBean.setQualifiedName(claim.getNamespace().toString());
+            }
+            attributeBean.setAttributeValues(Collections.singletonList(claim.getValue()));
+            attributeList.add(attributeBean);
+        }
+        attrBean.setSamlAttributes(attributeList);
+
+        return attrBean;
+    }
+
+}
+

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsHandler.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsHandler.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsHandler.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sts.claims;
+
+import java.net.URI;
+import java.security.Principal;
+import java.util.List;
+
+/**
+ * This interface provides a pluggable way to handle Claims.
+ */
+public interface ClaimsHandler {
+
+    List<URI> getSupportedClaimTypes();
+
+    ClaimCollection retrieveClaimValues(Principal principal, RequestClaimCollection claims);
+
+}
+ 
\ No newline at end of file

Added: cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java?rev=1173182&view=auto
==============================================================================
--- cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java (added)
+++ cxf/trunk/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/ClaimsManager.java Tue Sep 20 15:12:07 2011
@@ -0,0 +1,68 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.sts.claims;
+
+import java.net.URI;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This class holds various ClaimsHandler implementations.
+ */
+public class ClaimsManager {
+        
+    private List<ClaimsHandler> claimHandlers;
+    private List<URI> supportedClaimTypes = new ArrayList<URI>();
+
+    public List<URI> getSupportedClaimTypes() {
+        return supportedClaimTypes;
+    }
+
+    public List<ClaimsHandler> getClaimHandlers() {
+        return claimHandlers;
+    }
+
+    public void setClaimHandlers(List<ClaimsHandler> claimHandlers) {
+        this.claimHandlers = claimHandlers;
+        if (claimHandlers == null) {
+            supportedClaimTypes.clear();
+        } else {
+            for (ClaimsHandler handler : claimHandlers) {
+                supportedClaimTypes.addAll(handler.getSupportedClaimTypes());
+            }
+        }
+    }
+
+    public ClaimCollection retrieveClaimValues(Principal principal, RequestClaimCollection claims) {
+        if (claimHandlers != null && claimHandlers.size() > 0) {
+            ClaimCollection returnCollection = new ClaimCollection();
+            for (ClaimsHandler handler : claimHandlers) {
+                ClaimCollection claimCollection = handler.retrieveClaimValues(principal, claims);
+                if (claimCollection != null && claimCollection.size() != 0) {
+                    returnCollection.addAll(claimCollection);
+                }
+            }
+            return returnCollection;
+        }
+        return null;
+    }
+
+}



Mime
View raw message