cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1089991 - in /cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider: operation/impl/ token/
Date Thu, 07 Apr 2011 20:30:06 GMT
Author: dkulp
Date: Thu Apr  7 20:30:06 2011
New Revision: 1089991

URL: http://svn.apache.org/viewvc?rev=1089991&view=rev
Log:
Fixed issue with token type
author: anubhavsharma

Modified:
    cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/operation/impl/SAMLTokenIssueOperation.java
    cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/Saml1TokenProvider.java
    cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/Saml2TokenProvider.java
    cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/TokenProvider.java

Modified: cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/operation/impl/SAMLTokenIssueOperation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/operation/impl/SAMLTokenIssueOperation.java?rev=1089991&r1=1089990&r2=1089991&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/operation/impl/SAMLTokenIssueOperation.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/operation/impl/SAMLTokenIssueOperation.java
Thu Apr  7 20:30:06 2011
@@ -86,7 +86,7 @@ public class SAMLTokenIssueOperation imp
         = new org.apache.cxf.ws.security.sts.provider.model.ObjectFactory();
     private 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();
-
+    
     private static final String SIGN_FACTORY_TYPE = "DOM";
     private static final String JKS_INSTANCE = "JKS";
     private static final String X_509 = "X.509";
@@ -114,7 +114,7 @@ public class SAMLTokenIssueOperation imp
         String tokenType = SAMLConstants.SAML20_NS;
         X509Certificate certificate = null;
         String username = null;
-
+  
         // parse input arguments
         for (Object requestObject : request.getAny()) {
             // certificate
@@ -184,7 +184,7 @@ public class SAMLTokenIssueOperation imp
 
         // prepare response
         RequestSecurityTokenResponseType response = wrapAssertionToResponse(
-                tokenType, elementToken, tokenId);
+                tokenProvider.getResponseTokentype(), elementToken, tokenId);
 
         RequestSecurityTokenResponseCollectionType responseCollection = WS_TRUST_FACTORY
                 .createRequestSecurityTokenResponseCollectionType();

Modified: cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/Saml1TokenProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/Saml1TokenProvider.java?rev=1089991&r1=1089990&r2=1089991&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/Saml1TokenProvider.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/Saml1TokenProvider.java
Thu Apr  7 20:30:06 2011
@@ -39,6 +39,11 @@ import org.opensaml.xml.signature.KeyInf
 public class Saml1TokenProvider implements TokenProvider {
 
     private static final Logger LOG = LogUtils.getL7dLogger(Saml1TokenProvider.class);
+    private static final String RESPONSE_TOKENTYPE_SAML1 = "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1";
+    
+    public String getResponseTokentype() {
+        return RESPONSE_TOKENTYPE_SAML1;
+    }
 
     public String getTokenType() {
         return SAMLConstants.SAML1_NS;

Modified: cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/Saml2TokenProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/Saml2TokenProvider.java?rev=1089991&r1=1089990&r2=1089991&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/Saml2TokenProvider.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/Saml2TokenProvider.java
Thu Apr  7 20:30:06 2011
@@ -58,9 +58,13 @@ import org.opensaml.xml.signature.KeyInf
 public class Saml2TokenProvider implements TokenProvider {
 
     private static final String SAML_AUTH_CONTEXT = "ac:classes:X509";
-    
+    private static final String RESPONSE_TOKENTYPE_SAML2 = "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0";
     private static final Logger LOG = LogUtils.getL7dLogger(Saml2TokenProvider.class);
 
+    public String getResponseTokentype() {
+        return RESPONSE_TOKENTYPE_SAML2;
+    }
+    
     public String getTokenType() {
         return SAMLConstants.SAML20_NS;
     }

Modified: cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/TokenProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/TokenProvider.java?rev=1089991&r1=1089990&r2=1089991&view=diff
==============================================================================
--- cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/TokenProvider.java
(original)
+++ cxf/trunk/distribution/src/main/release/samples/sts_issue_operation/src/main/java/demo/sts/provider/token/TokenProvider.java
Thu Apr  7 20:30:06 2011
@@ -32,4 +32,6 @@ public interface TokenProvider {
     Element createToken(X509Certificate certificate);
 
     String getTokenId(Element token);
+    
+    String getResponseTokentype();
 }



Mime
View raw message