ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1469282 - /webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SAMLCallback.java
Date Thu, 18 Apr 2013 11:12:46 GMT
Author: coheigea
Date: Thu Apr 18 11:12:46 2013
New Revision: 1469282

URL: http://svn.apache.org/r1469282
Log:
Get the Subject from any of the SAML 1.1 statements if it is not set on the SAMLCallback object

Modified:
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SAMLCallback.java

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SAMLCallback.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SAMLCallback.java?rev=1469282&r1=1469281&r2=1469282&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SAMLCallback.java
(original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SAMLCallback.java
Thu Apr 18 11:12:46 2013
@@ -178,7 +178,36 @@ public class SAMLCallback implements Cal
      * @return the subject (type SubjectBean) of this SAMLCallback object.
      */
     public SubjectBean getSubject() {
-        return subject;
+        if (subject != null) {
+            return subject;
+        }
+        
+        // SAML 1.1 case
+        if (authenticationStatementData != null) {
+            for (AuthenticationStatementBean bean : authenticationStatementData) {
+                if (bean.getSubject() != null) {
+                    return bean.getSubject();
+                }
+            }
+        }
+        
+        if (attributeStatementData != null) {
+            for (AttributeStatementBean bean : attributeStatementData) {
+                if (bean.getSubject() != null) {
+                    return bean.getSubject();
+                }
+            }
+        }
+        
+        if (authDecisionStatementData != null) {
+            for (AuthDecisionStatementBean bean : authDecisionStatementData) {
+                if (bean.getSubject() != null) {
+                    return bean.getSubject();
+                }
+            }
+        }
+        
+        return null;
     }
 
     /**



Mime
View raw message