Examples of SSOSite


Examples of org.apache.jetspeed.sso.SSOSite

        // Set the content type
        response.setContentType("text/html");       
        try
        {
          StringBuffer page= new StringBuffer();
          SSOSite site = sso.getSiteByUrl(ssoSite);
          if (site == null)
          {
            response.getWriter().println("<P>Could not find site with name "+ssoSite+"</P>");
            return;
          }
          if (destinationURL == null)
          {
            destinationURL = site.getURL();
          }         
          Principal p = request.getUserPrincipal();
          if (p instanceof JetspeedPrincipal)
          {
                Collection<SSOUser> remoteUsers = sso.getRemoteUsers(site,getSubject());
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

    {
        List resultSetTitleList = new ArrayList();
        List resultSetTypeList = new ArrayList();
        try
        {
            SSOSite site = null;
            Iterator principals = null;
            List list = null;
            resultSetTypeList.add(String.valueOf(Types.VARCHAR));
            resultSetTitleList.add("Principal");
            resultSetTypeList.add(String.valueOf(Types.VARCHAR));
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

            else if (delete != null && !(isEmpty(delete)))
            {
                try
                {
                    String siteName = (String)PortletMessaging.receive(request, "site", "selectedUrl");                                           
                    SSOSite site = sso.getSite(siteName);
                    User user = null;
                    try
                    {
                        user = userManager.getUser(delete);  
                    }
                    catch(SecurityException se)
                    {
                        // User doesn't exist -- maybe a group
                        user =null;
                    }
                   
                    if ( site != null )
                    {
                        /*
                       * If the user is null try to remove a group
                       */
                      if ( user != null)
                      {
                          // Remove USER
                          Subject subject = user.getSubject();
                          sso.removeCredentialsForSite(subject, site.getSiteURL());
                          this.clearBrowserIterator(request);
                      }
                      else
                      {
                          // Try group removal
                          String fullPath = "/group/" + delete;
                          sso.removeCredentialsForSite(fullPath, site.getSiteURL());
                          this.clearBrowserIterator(request);
                     
                   }
                }
                catch (SSOException e)
                {
                    publishStatusMessage(request, "SSODetails", "status", e, "Could not remove credentials");
                }
            }
            else if (add != null)
            {
                // Roger: here is the principal type
                String principalType = request.getParameter("principal.type")//group user
                String portalPrincipal = request.getParameter("portal.principal");               
                String remotePrincipal = request.getParameter("remote.principal");
                String remoteCredential = request.getParameter("remote.credential");
               
                // The principal type can benull if the user just typed the name instead of
                // using the choosers.
               
                if (principalType == null || principalType.length() == 0 )
                    principalType = "user";
               
                if (!(isEmpty(remotePrincipal) || isEmpty(remotePrincipal) || isEmpty(remoteCredential)))
                {
                    try
                    {
                        String siteName = (String)PortletMessaging.receive(request, "site", "selectedUrl");                       
                        SSOSite site = sso.getSite(siteName);
                        Subject subject = null;
                        String groupFullPath = null;
                       
                        if (principalType.compareTo("user") == 0)
                        {
                            User user = userManager.getUser(portalPrincipal);   
                            subject = user.getSubject();
                        }
                        else
                        {
                            // Create fullPath
                            groupFullPath = "/group/" + portalPrincipal;
                          }
                       
                        if (site != null && (subject != null || groupFullPath != null) )
                        {
                            if (subject != null )
                                sso.addCredentialsForSite(subject, remotePrincipal, site.getSiteURL(), remoteCredential);
                            else
                                sso.addCredentialsForSite(groupFullPath, remotePrincipal, site.getSiteURL(), remoteCredential);
                           
                            this.clearBrowserIterator(request);
                        }
                    }
                    catch (SSOException e)
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

            List list = new ArrayList();
            while (sites.hasNext())
            {
                List row = new ArrayList(2);
                SSOSite site = (SSOSite)sites.next();
                row.add(0, site.getSiteURL());                    
                row.add(1, site.getName());
                list.add(row);
            }           
            BrowserIterator iterator = new DatabaseBrowserIterator(
                    list, resultSetTitleList, resultSetTypeList,
                    windowSize);
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

        if (request.getPortletMode() == PortletMode.VIEW)
        {
            String selectedSite = request.getParameter("ssoSite");
            if (selectedSite != null)
            {
                SSOSite site = sso.getSite(selectedSite);
                if (site != null)
                {
                    PortletMessaging.publish(request, "site", "selectedUrl", selectedSite);
                    PortletMessaging.publish(request, "site", "selectedName", site.getName());
                    PortletMessaging.publish(request, "site", "change", selectedSite);
                }
            }
            String refresh = request.getParameter("sso.refresh");
            String save = request.getParameter("sso.save");
            String neue = request.getParameter("sso.new");
            String delete = request.getParameter("ssoDelete");
           
            if (refresh != null)
            {
                this.clearBrowserIterator(request);
            }
            else if (neue != null)
            {
                PortletMessaging.cancel(request, "site", "selected");
                PortletMessaging.cancel(request, "site", "selectedUrl");                               
            }
            else if (delete != null && (!(isEmpty(delete))))
            {
                try
                {
                    SSOSite site = null;
                    site = sso.getSite(delete);
                    if (site != null)
                    {
                        sso.removeSite(site);
                        this.clearBrowserIterator(request);
                        PortletMessaging.cancel(request, "site", "selected");
                        PortletMessaging.cancel(request, "site", "selectedUrl");                               
                    }
                }
                catch (SSOException e)
                {
                    publishStatusMessage(request, "SSOBrowser", "status", e, "Could not remove site");
                }
            }
            else if (save != null)
            {
                String siteName = request.getParameter("site.name");               
                String siteUrl = request.getParameter("site.url");
                if (!(isEmpty(siteName) || isEmpty(siteUrl)))
                {
                    try
                    {
                        SSOSite site = null;
                        String old = (String)PortletMessaging.receive(request, "site", "selectedUrl");
                        if (old != null)
                        {
                            site = sso.getSite(old);
                        }
                        else
                        {
                            site = sso.getSite(siteUrl);
                        }                       
                        if (site != null)
                        {
                            site.setName(siteName);
                            site.setSiteURL(siteUrl);
                            sso.updateSite(site);
                            this.clearBrowserIterator(request);
                            PortletMessaging.publish(request, "site", "selectedName", siteName);
                            PortletMessaging.publish(request, "site", "selectedUrl", siteUrl);                           
                        }
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

       * given user site url combination
       */
      String proxyID = fullPath + "_" + SSOSite;
     
      // Get the site
      SSOSite ssoSite = getSSOSiteObject(SSOSite);
   
    if ( ssoSite != null)
    {
      SSOSite[] sites = new SSOSite[1];
      sites[0] = ssoSite;
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

      SSOSite[] ssoSites = new SSOSite[siteSize];
     
      Iterator itSites = sites.iterator();
      while(itSites.hasNext())
      {
        SSOSite ssoSite = (SSOSite)itSites.next();
        if (ssoSite != null)
        {
          ssoSites[siteIndex] = ssoSite;
          siteIndex++;
        }
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

    }
   

    public void setRealmForSite(String site, String realm) throws SSOException
    {
      SSOSite ssoSite = getSSOSiteObject(site);
   
    if ( ssoSite != null)
    {
      try
      {
        ssoSite.setRealm(realm);
        getPersistenceBrokerTemplate().store(ssoSite);
      }
      catch (Exception e)
      {
        throw new SSOException("Failed to set the realm for site [" + site + "] Error" +e );
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

    }
    }
   
    public String getRealmForSite(String site) throws SSOException
    {
      SSOSite ssoSite = getSSOSiteObject(site);
   
    if ( ssoSite != null)
    {
      return ssoSite.getRealm();
    }
   
    return null;
    }
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

    /**
     * getSiteName
     */
    public String getSiteName(String site)
    {
        SSOSite ssoSite = getSSOSiteObject(site);
   
    if ( ssoSite != null)
    {
      return ssoSite.getName();
    }
    else
    {
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.