Examples of SSOSite


Examples of org.apache.jetspeed.sso.SSOSite

    public SSOSite getSite(String siteUrl)
    {
        Criteria filter = new Criteria();
        filter.addEqualTo("url", siteUrl);
        Query query = QueryFactory.newQuery(SSOSiteImpl.class, filter);
        SSOSite site = (SSOSite) getPersistenceBrokerTemplate().getObjectByQuery(query);
        return site;      
    }
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

    public void addSiteFormAuthenticated(String siteName, String siteUrl, String realm, String userField, String pwdField)
    throws SSOException
    {
      try
        {
            SSOSite ssoSite = new SSOSiteImpl();
            ssoSite.setSiteURL(siteUrl);
            ssoSite.setName(siteName);
            ssoSite.setCertificateRequired(false);
            ssoSite.setAllowUserSet(true);
            ssoSite.setRealm(realm);
            ssoSite.setFormAuthentication(true);
            ssoSite.setFormUserField(userField);
            ssoSite.setFormPwdField(pwdField);
            getPersistenceBrokerTemplate().store(ssoSite);
            this.mapSite.put(siteName, ssoSite);           
        }
        catch (Exception e)
        {
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

    public void addSiteChallengeResponse(String siteName, String siteUrl, String realm)
    throws SSOException
    {
      try
        {
            SSOSite ssoSite = new SSOSiteImpl();
            ssoSite.setSiteURL(siteUrl);
            ssoSite.setName(siteName);
            ssoSite.setCertificateRequired(false);
            ssoSite.setAllowUserSet(true);
            ssoSite.setRealm(realm);
            ssoSite.setChallengeResponseAuthentication(true);
             getPersistenceBrokerTemplate().store(ssoSite);
            this.mapSite.put(siteName, ssoSite);           
        }
        catch (Exception e)
        {
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

    public void addSite(String siteName, String siteUrl)
    throws SSOException
    {
        try
        {
            SSOSite ssoSite = new SSOSiteImpl();
            ssoSite.setSiteURL(siteUrl);
            ssoSite.setName(siteName);
            ssoSite.setCertificateRequired(false);
            ssoSite.setAllowUserSet(true);           
            getPersistenceBrokerTemplate().store(ssoSite);
            this.mapSite.put(siteName, ssoSite);           
        }
        catch (Exception e)
        {
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

        int numberOfSites = sites.length;
       
        // Do all the logins for the site
        for (int i=0; i<numberOfSites; i++)
        {
          SSOSite site = sites[i];
         
          if (site != null)
          {
            Iterator itRemotePrincipals = site.getRemotePrincipals().iterator();
            while (itRemotePrincipals.hasNext() )
            {
              InternalUserPrincipal remotePrincipal = (InternalUserPrincipal)itRemotePrincipals.next();
                  if (remotePrincipal != null)
                  {
                    InternalCredential credential = null;
                    if ( remotePrincipal.getCredentials() != null)
                      credential = (InternalCredential)remotePrincipal.getCredentials().iterator().next();
                   
                    if (credential != null)
                    {
                      if (log.isInfoEnabled())
                        log.info("SSOComponent -- Remote Principal ["+stripPrincipalName(remotePrincipal.getFullPath())+"] has credential ["+this.unscramble(credential.getValue())+ "]");
                     
                      client.getState().setCredentials(
                            site.getRealm(),
                                  urlObj.getHost(),
                                  new UsernamePasswordCredentials(stripPrincipalName(remotePrincipal.getFullPath())this.unscramble(credential.getValue()))
                              );
                     
                      // Build URL if it's Form authentication
                      StringBuffer siteURL = new StringBuffer(site.getSiteURL());
                    
                    // Check if it's form based or ChallengeResponse
                    if (site.isFormAuthentication())
                    {
                      siteURL.append("?").append(site.getFormUserField()).append("=").append(stripPrincipalName(remotePrincipal.getFullPath())).append("&").append(site.getFormPwdField()).append("=").append(this.unscramble(credential.getValue()));
                    }
                     
                      get = new GetMethod(siteURL.toString());
 
                            // Tell the GET method to automatically handle authentication. The
                            // method will use any appropriate credentials to handle basic
                            // authentication requests.  Setting this value to false will cause
                            // any request for authentication to return with a status of 401.
                            // It will then be up to the client to handle the authentication.
                            get.setDoAuthentication( true );
                            try {
                                // execute the GET
                                int status = client.executeMethod( get );
                               
                                if (log.isInfoEnabled() )
                                    log.info("Accessing site [" + site.getSiteURL() + "]. HTTP Status [" +status+ "]" );
                               
                                /*
                             * If the destination URL and the SSO url match
                             * use the authentication process but return immediately
                             * the result page.
                             */
                                if( destUrl.compareTo(site.getSiteURL()) == 0 && numberOfSites == 1)
                                {
                                  if (log.isInfoEnabled() )
                                    log.info("SSO Component --SSO Site and destination URL match. Go and get the content." );
                                 
                                  //try
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

        }
        while (list.hasNext())
        {
            try
            {
                SSOSite s = (SSOSite) list.next();               
                if (!(ssoSitesMap.containsKey(s.getSiteURL())))
                {
                    JSSSOSite site = createSSOSite(s);
                    ssoSitesMap.put(site.getSiteURL(), site);
                    ((JSSeedData)getSnapshot()).getSSOSites().add(site);
                }
View Full Code Here

Examples of org.apache.jetspeed.sso.SSOSite

            while (sitesIter.hasNext())
            {
                JSSSOSite site = (JSSSOSite)sitesIter.next();
                try
                {
                    SSOSite s = ssoProvider.getSite(site.getSiteURL());
                    if ((s == null) || getSetting(JetspeedSerializer.KEY_OVERWRITE_EXISTING))
                    {
                        s = recreateSSOSite(ssoProvider, site, s);
                        ssoProvider.updateSite(s);       
                    }
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
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.