Examples of CasConfig


Examples of com.discursive.cas.extend.client.CASConfig

      // Note: this is a workaround for a situation where a JAR in common/lib contains CASConfig
      //       and the JAR that contains CASFilter also contains the CASConfig class.  In this
      //      case, the class-cast will fail so, we copy the know bean-properties instead.
      // Note: if anyone knows a beter way to handle this please contact the developers
      Object object = envCtx.lookup(jndiInit);
      CASConfig casConfig = new CASConfig();
      try {
      PropertyUtils.copyProperties( casConfig, object );
    } catch (Exception e) {
      log.error( "Error copying properties from JNDI CASConfig to Filter CASConfig", e );
    }
View Full Code Here

Examples of com.discursive.cas.extend.client.CASConfig

    }
    return casConfig;
    }
   
    public CASConfig configureFromInitParams(FilterConfig config) {
      CASConfig casConfig = new CASConfig();
      casConfig.setCasLogin(
            config.getInitParameter(
                LOGIN_INIT_PARAM)
                );
        casConfig.setCasValidate(
            config.getInitParameter(
                VALIDATE_INIT_PARAM)
                );
        casConfig.setCasServiceUrl(
            config.getInitParameter(
                SERVICE_INIT_PARAM)
                );
        casConfig.setCasAuthorizedProxy(
            config.getInitParameter(
                AUTHORIZED_PROXY_INIT_PARAM)
                );
        casConfig.setCasRenew(
            Boolean.valueOf(config.getInitParameter(RENEW_INIT_PARAM)).booleanValue() );
        casConfig.setCasServerName(
            config.getInitParameter(
                SERVERNAME_INIT_PARAM)
                );
        casConfig.setMultiServerName(
                config.getInitParameter(
                    MULTI_SERVERNAME_INIT_PARAM)
                    );
        casConfig.setCasProxyCallbackUrl(
            config.getInitParameter(
                PROXY_CALLBACK_INIT_PARAM)
                );
        casConfig.setWrapRequest(
            Boolean
                .valueOf(
                    config.getInitParameter(
                        WRAP_REQUESTS_INIT_PARAM))
                .booleanValue() );
        casConfig.setCasGateway(
            Boolean
                .valueOf(
                    config.getInitParameter(
                        GATEWAY_INIT_PARAM))
                .booleanValue() );
        casConfig.setServiceScheme(
            config.getInitParameter( SERVICE_SCHEME_INIT_PARAM ) );
        casConfig.setDummyTrust(
                Boolean.valueOf(config.getInitParameter(DUMMY_TRUST_INIT_PARAM)).booleanValue() );
        return casConfig;
    }
View Full Code Here

Examples of com.discursive.cas.extend.client.CASConfig

      // Note: this is a workaround for a situation where a JAR in common/lib contains CASConfig
      //       and the JAR that contains CASFilter also contains the CASConfig class.  In this
      //      case, the class-cast will fail so, we copy the know bean-properties instead.
      // Note: if anyone knows a beter way to handle this please contact the developers
      Object object = envCtx.lookup(jndiInit);
      CASConfig casConfig = new CASConfig();
      try {
      PropertyUtils.copyProperties( casConfig, object );
    } catch (Exception e) {
      log.error( "Error copying properties from JNDI CASConfig to Filter CASConfig", e );
    }
View Full Code Here

Examples of com.discursive.cas.extend.client.CASConfig

    }
    return casConfig;
    }
   
    public CASConfig configureFromInitParams(FilterConfig config) {
      CASConfig casConfig = new CASConfig();
      casConfig.setCasLogin(
            config.getInitParameter(
                LOGIN_INIT_PARAM)
                );
        casConfig.setCasValidate(
            config.getInitParameter(
                VALIDATE_INIT_PARAM)
                );
        casConfig.setCasServiceUrl(
            config.getInitParameter(
                SERVICE_INIT_PARAM)
                );
        casConfig.setCasAuthorizedProxy(
            config.getInitParameter(
                AUTHORIZED_PROXY_INIT_PARAM)
                );
        casConfig.setCasRenew(
            Boolean.valueOf(config.getInitParameter(RENEW_INIT_PARAM)).booleanValue() );
        casConfig.setCasServerName(
            config.getInitParameter(
                SERVERNAME_INIT_PARAM)
                );
        casConfig.setMultiServerName(
                config.getInitParameter(
                    MULTI_SERVERNAME_INIT_PARAM)
                    );
        casConfig.setCasProxyCallbackUrl(
            config.getInitParameter(
                PROXY_CALLBACK_INIT_PARAM)
                );
        casConfig.setWrapRequest(
            Boolean
                .valueOf(
                    config.getInitParameter(
                        WRAP_REQUESTS_INIT_PARAM))
                .booleanValue() );
        casConfig.setCasGateway(
            Boolean
                .valueOf(
                    config.getInitParameter(
                        GATEWAY_INIT_PARAM))
                .booleanValue() );
        casConfig.setDummyTrust(
                Boolean.valueOf(config.getInitParameter(DUMMY_TRUST_INIT_PARAM)).booleanValue() );
        return casConfig;
    }
View Full Code Here

Examples of org.beangle.security.cas.CasConfig

  CasConfig config;

  @BeforeMethod
  public void setUp() {
    filter = new CasPreauthFilter();
    config = new CasConfig();
    filter.setConfig(config);
    config.setLocalServer("http://localhost/demo");
  }
View Full Code Here

Examples of org.beangle.security.cas.CasConfig

@Test
public class CasEntryPointTest {

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testDetectsMissingUrl() throws Exception {
    CasConfig config = new CasConfig();
    config.afterPropertiesSet();
    CasEntryPoint ep = new CasEntryPoint(config);
    ep.afterPropertiesSet();
  }
View Full Code Here

Examples of org.beangle.security.cas.CasConfig

  public void testDetectsMissingConfig() throws Exception {
    new CasEntryPoint().afterPropertiesSet();
  }

  public void testGettersSetters() {
    CasConfig config = new CasConfig("https://cas", null);
    assertEquals("https://cas", config.getCasServer());

    CasEntryPoint ep = new CasEntryPoint(config);
    assertTrue(ep.getConfig() != null);
  }
View Full Code Here

Examples of org.beangle.security.cas.CasConfig

    CasEntryPoint ep = new CasEntryPoint(config);
    assertTrue(ep.getConfig() != null);
  }

  public void testNormalOperationWithRenewFalse() throws Exception {
    CasConfig config = new CasConfig("https://cas", "https://mycompany.com/bigWebApp");
    config.setRenew(false);
    CasEntryPoint ep = new CasEntryPoint(config);
    MockHttpServletRequest request = new MockHttpServletRequest(null, "/some_path");
    MockHttpServletResponse response = new MockHttpServletResponse();
    ep.afterPropertiesSet();
    ep.commence(request, response, null);
View Full Code Here

Examples of org.beangle.security.cas.CasConfig

        "https://cas/login?service="
            + URLEncoder.encode("https://mycompany.com/bigWebApp/some_path", "UTF-8"));
  }

  public void testNormalOperationWithRenewTrue() throws Exception {
    CasConfig config = new CasConfig("https://cas", "https://mycompany.com/bigWebApp");
    config.setRenew(true);
    CasEntryPoint ep = new CasEntryPoint(config);
    MockHttpServletRequest request = new MockHttpServletRequest(null, "/some_path");
    MockHttpServletResponse response = new MockHttpServletResponse();
    ep.afterPropertiesSet();
    ep.commence(request, response, null);
View Full Code Here

Examples of org.beangle.security.cas.CasConfig

*/
@Test
public class CommonUtilsTest {

  public void testConstuctServiceUrl() {
    CasConfig config = new CasConfig();
    config.setCasServer("http://www.mycompany.com/cas");
    config.setLocalServer("localhost:8080/demo");
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setContextPath("/demo");
    request.setServletPath("/home.action");
    request.setRequestURI("/demo/home.action");
    System.out.println(request.getRequestURI());
    HttpServletResponse response = new MockHttpServletResponse();
    final String urlEncodedService = CommonUtils.constructServiceUrl(request, response, null,
        config.getLocalServer(), "ticket", config.isEncode());
    System.out.println(urlEncodedService);

    final String urlEncodedService2 = CommonUtils.constructServiceUrl(request, response, null,
        "localhost:8080", "ticket", config.isEncode());
   
    System.out.println(urlEncodedService2);
  }
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.