portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r598994 - in /portals/jetspeed-2/branches/JETSPEED-2.1.3/components/web-content/src/java/org/apache/jetspeed/portlet: SSOIFramePortlet.java SSOWebContentPortlet.java
Date Wed, 28 Nov 2007 13:31:44 GMT
Author: ate
Date: Wed Nov 28 05:31:43 2007
New Revision: 598994

URL: http://svn.apache.org/viewvc?rev=598994&view=rev
Log:
Fix for JS2-815: SSOIframePortlet doesn't save changed remote principal name
See: https://issues.apache.org/jira/browse/JS2-815
Patch provided by Dennis Dam, thanks
NB: I've applied the same patch to the SSOWebContentPortlet as that had the same problem.

Modified:
    portals/jetspeed-2/branches/JETSPEED-2.1.3/components/web-content/src/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java
    portals/jetspeed-2/branches/JETSPEED-2.1.3/components/web-content/src/java/org/apache/jetspeed/portlet/SSOWebContentPortlet.java

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/components/web-content/src/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/components/web-content/src/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java?rev=598994&r1=598993&r2=598994&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/components/web-content/src/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java
(original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/components/web-content/src/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java
Wed Nov 28 05:31:43 2007
@@ -167,11 +167,20 @@
             Subject subject = getSubject();
             if (sso.hasSSOCredentials(subject, site))
             {
-                sso.updateCredentialsForSite(getSubject(), ssoPrincipal, site, ssoCredential);
+            	SSOContext context = sso.getCredentials(subject, site);
+            	if (!context.getRemotePrincipalName().equals(ssoPrincipal))
+            	{
+            		sso.removeCredentialsForSite(subject, site);
+            		sso.addCredentialsForSite(subject, ssoPrincipal, site, ssoCredential);
+            	}
+            	else
+            	{
+            		sso.updateCredentialsForSite(subject, ssoPrincipal, site, ssoCredential);
+            	}
             }
             else
             {
-                sso.addCredentialsForSite(getSubject(), ssoPrincipal, site, ssoCredential);
+                sso.addCredentialsForSite(subject, ssoPrincipal, site, ssoCredential);
             }
         }
         catch (SSOException e)

Modified: portals/jetspeed-2/branches/JETSPEED-2.1.3/components/web-content/src/java/org/apache/jetspeed/portlet/SSOWebContentPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/branches/JETSPEED-2.1.3/components/web-content/src/java/org/apache/jetspeed/portlet/SSOWebContentPortlet.java?rev=598994&r1=598993&r2=598994&view=diff
==============================================================================
--- portals/jetspeed-2/branches/JETSPEED-2.1.3/components/web-content/src/java/org/apache/jetspeed/portlet/SSOWebContentPortlet.java
(original)
+++ portals/jetspeed-2/branches/JETSPEED-2.1.3/components/web-content/src/java/org/apache/jetspeed/portlet/SSOWebContentPortlet.java
Wed Nov 28 05:31:43 2007
@@ -160,11 +160,20 @@
                 Subject subject = getSubject();
                 if (sso.hasSSOCredentials(subject, site))
                 {
-                    sso.updateCredentialsForSite(getSubject(), ssoPrincipal, site, ssoCredential);
+                    SSOContext context = sso.getCredentials(subject, site);
+                    if (!context.getRemotePrincipalName().equals(ssoPrincipal))
+                    {
+                        sso.removeCredentialsForSite(subject, site);
+                        sso.addCredentialsForSite(subject, ssoPrincipal, site, ssoCredential);
+                    }
+                    else
+                    {
+                        sso.updateCredentialsForSite(subject, ssoPrincipal, site, ssoCredential);
+                    }
                 }
                 else
                 {
-                    sso.addCredentialsForSite(getSubject(), ssoPrincipal, site, ssoCredential);
+                    sso.addCredentialsForSite(subject, ssoPrincipal, site, ssoCredential);
                 }
             }
             catch (SSOException e)



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message