portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/web-content/src/java/org/apache/jetspeed/portlet SSOIFramePortlet.java
Date Tue, 30 Nov 2004 19:01:10 GMT
taylor      2004/11/30 11:01:10

  Modified:    components/web-content/src/java/org/apache/jetspeed/portlet
                        SSOIFramePortlet.java
  Log:
  updated to latest api
  checking this in so Roger can have a look
  
  Revision  Changes    Path
  1.3       +17 -10    jakarta-jetspeed-2/components/web-content/src/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java
  
  Index: SSOIFramePortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/web-content/src/java/org/apache/jetspeed/portlet/SSOIFramePortlet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SSOIFramePortlet.java	28 Nov 2004 19:02:23 -0000	1.2
  +++ SSOIFramePortlet.java	30 Nov 2004 19:01:10 -0000	1.3
  @@ -54,6 +54,12 @@
       public static final String SSO_REQUEST_ATTRIBUTE_USERNAME = "sso.ra.username";
       public static final String SSO_REQUEST_ATTRIBUTE_PASSWORD = "sso.ra.password";
   
  +    /*
  +     * The constants must be used in your HTML form for the SSO principal and credential
  +     */
  +    public static final String SSO_FORM_PRINCIPAL = "ssoPrincipal";
  +    public static final String SSO_FORM_CREDENTIAL = "ssoCredential";
  +    
       private PortletContext context;
       private SSOProvider sso;
   
  @@ -76,8 +82,8 @@
               Subject subject = getSubject();                 
               String site = request.getPreferences().getValue("SRC", "");
               SSOContext context = sso.getCredentials(subject, site);
  -            getContext(request).put("ssoUserName", context.getUserName());
  -            getContext(request).put("ssoCredential", context.getPassword());
  +            getContext(request).put(SSO_FORM_PRINCIPAL, context.getUserName());
  +            getContext(request).put(SSO_FORM_CREDENTIAL, context.getPassword());
           }
           catch (SSOException e)
           {
  @@ -85,8 +91,8 @@
               {
                   // no credentials configured in SSO store
                   // switch to SSO Configure View
  -                getContext(request).put("ssoUserName", "");
  -                getContext(request).put("ssoCredential", "");
  +                getContext(request).put(SSO_FORM_PRINCIPAL, "");
  +                getContext(request).put(SSO_FORM_CREDENTIAL, "");
               }
               else
               {
  @@ -140,20 +146,21 @@
           // save the prefs
           super.processAction(request, actionResponse);
           
  -        // save the SSO params
  -        String ssoUserName = request.getParameter("ssoUserName");
  -        String ssoCredential = request.getParameter("ssoCredential");
  +        // get the POST params -- requires HTML post params named
  +        // ssoUserName 
  +        String ssoPrincipal = request.getParameter(SSO_FORM_PRINCIPAL);
  +        String ssoCredential = request.getParameter(SSO_FORM_CREDENTIAL);
           String site = request.getPreferences().getValue("SRC", "");
           try
           {
               Subject subject = getSubject();
               if (sso.hasSSOCredentials(subject, site))
               {
  -                sso.updateCredentialsForSite(getSubject(), "TODO", site, ssoCredential);
  +                sso.updateCredentialsForSite(getSubject(), ssoPrincipal, site, ssoCredential);
               }
               else
               {
  -                sso.addCredentialsForSite(getSubject(), "TODO", site, ssoCredential);
  +                sso.addCredentialsForSite(getSubject(), ssoPrincipal, site, ssoCredential);
               }
           }
           catch (SSOException e)
  
  
  

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


Mime
View raw message