public void doEdit(RenderRequest request, RenderResponse response)
     throws PortletException, IOException {
   String site = request.getPreferences().getValue("SRC", "");
   PasswordCredential pwc = SSOPortletUtil.getCredentialsForSite(sso, site, request);
   if (pwc != null) {
     getContext(request).put(SSO_EDIT_FIELD_PRINCIPAL, pwc.getUserName());
     getContext(request).put(SSO_EDIT_FIELD_CREDENTIAL, pwc.getPassword());
   } else {
     // no credentials configured in SSO store
     // switch to SSO Configure View
     getContext(request).put(SSO_EDIT_FIELD_PRINCIPAL, "");
     getContext(request).put(SSO_EDIT_FIELD_CREDENTIAL, "");
   }
   StatusMessage msg =
       (StatusMessage) PortletMessaging.consume(request, "SSOWebContent", "status");
   if (msg != null) {
     this.getContext(request).put("statusMsg", msg);
   }
   this.getContext(request).put("ssoTypes", SSO_TYPES);
   this.getContext(request)
       .put("ssoTypeSelected", request.getPreferences().getValue("sso.type", SSO_TYPE_BASIC));
   super.doEdit(request, response);
 }