portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r598996 - in /portals/jetspeed-2/trunk/components/jetspeed-web-content/src/main/java/org/apache/jetspeed/portlet: SSOIFramePortlet.java SSOWebContentPortlet.java
Date Wed, 28 Nov 2007 13:35:54 GMT
Author: ate
Date: Wed Nov 28 05:35:54 2007
New Revision: 598996

URL: http://svn.apache.org/viewvc?rev=598996&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/trunk/components/jetspeed-web-content/src/main/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java
    portals/jetspeed-2/trunk/components/jetspeed-web-content/src/main/java/org/apache/jetspeed/portlet/SSOWebContentPortlet.java

Modified: portals/jetspeed-2/trunk/components/jetspeed-web-content/src/main/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-web-content/src/main/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java?rev=598996&r1=598995&r2=598996&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-web-content/src/main/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java
(original)
+++ portals/jetspeed-2/trunk/components/jetspeed-web-content/src/main/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java
Wed Nov 28 05:35:54 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/trunk/components/jetspeed-web-content/src/main/java/org/apache/jetspeed/portlet/SSOWebContentPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-web-content/src/main/java/org/apache/jetspeed/portlet/SSOWebContentPortlet.java?rev=598996&r1=598995&r2=598996&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-web-content/src/main/java/org/apache/jetspeed/portlet/SSOWebContentPortlet.java
(original)
+++ portals/jetspeed-2/trunk/components/jetspeed-web-content/src/main/java/org/apache/jetspeed/portlet/SSOWebContentPortlet.java
Wed Nov 28 05:35:54 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