@Test public void testNewCas2ServiceValidator() throws Exception { context.checking(commonConfigExpectations()); context.checking(proxyTicketStorageExpectations()); context.checking(new Expectations() { { allowing(config).getProtocol(); will(returnValue(AuthenticationProtocol.CAS2_0)); allowing(config).isProxySupported(); will(returnValue(false)); } }); JasigAuthenticator authenticator = (JasigAuthenticator) AuthenticatorFactory.newInstance(config, PROXY_CALLBACK_URL, proxyCallbackHandler); assertThat(authenticator.getValidator(), instanceOf(Cas20ServiceTicketValidator.class)); }
public static Authenticator newInstance(Configuration config, String proxyCallbackUrl, ProxyCallbackHandler proxyCallbackHandler) { HttpsURLConnectionFactory connectionFactory = new HttpsURLConnectionFactory(config.getSslContext(), config.getHostnameVerifier()); TicketValidator validator = createTicketValidator(config, connectionFactory); if (validator instanceof Cas20ServiceTicketValidator) { configureServiceValidator(config, proxyCallbackUrl, proxyCallbackHandler, connectionFactory, (Cas20ServiceTicketValidator) validator); } if (validator instanceof Cas20ProxyTicketValidator) { configureProxyValidator(config, (Cas20ProxyTicketValidator) validator); } if (validator instanceof Saml11TicketValidator) { configureSamlValidator(config, (Saml11TicketValidator) validator); } return new JasigAuthenticator(config, validator); }
AuthenticatorFactory { public static Authenticator newInstance(Configuration config, String proxyCallbackUrl, ProxyCallbackHandler proxyCallbackHandler) { HttpsURLConnectionFactory connectionFactory = new HttpsURLConnectionFactory(config.getSslContext(), config.getHostnameVerifier()); TicketValidator validator = createTicketValidator(config, connectionFactory); if (validator instanceof Cas20ServiceTicketValidator) { configureServiceValidator(config, proxyCallbackUrl, proxyCallbackHandler, connectionFactory, (Cas20ServiceTicketValidator) validator); } if (validator instanceof Cas20ProxyTicketValidator) { configureProxyValidator(config, (Cas20ProxyTicketValidator) validator); } if (validator instanceof Saml11TicketValidator) { configureSamlValidator(config, (Saml11TicketValidator) validator); } return new JasigAuthenticator(config, validator); } }
AuthenticatorFactory { public static Authenticator newInstance(Configuration config, String proxyCallbackUrl, ProxyCallbackHandler proxyCallbackHandler) { HttpsURLConnectionFactory connectionFactory = new HttpsURLConnectionFactory(config.getSslContext(), config.getHostnameVerifier()); TicketValidator validator = createTicketValidator(config, connectionFactory); if (validator instanceof Cas20ServiceTicketValidator) { configureServiceValidator(config, proxyCallbackUrl, proxyCallbackHandler, connectionFactory, (Cas20ServiceTicketValidator) validator); } if (validator instanceof Cas20ProxyTicketValidator) { configureProxyValidator(config, (Cas20ProxyTicketValidator) validator); } if (validator instanceof Saml11TicketValidator) { configureSamlValidator(config, (Saml11TicketValidator) validator); } return new JasigAuthenticator(config, validator); }  }
AuthenticatorFactory { public static Authenticator newInstance(Configuration config, String proxyCallbackUrl, ProxyCallbackHandler proxyCallbackHandler) { HttpsURLConnectionFactory connectionFactory = new HttpsURLConnectionFactory(config.getSslContext(), config.getHostnameVerifier()); TicketValidator validator = createTicketValidator(config, connectionFactory); if (validator instanceof Cas20ServiceTicketValidator) { configureServiceValidator(config, proxyCallbackUrl, proxyCallbackHandler, connectionFactory, (Cas20ServiceTicketValidator) validator); } if (validator instanceof Cas20ProxyTicketValidator) { configureProxyValidator(config, (Cas20ProxyTicketValidator) validator); } if (validator instanceof Saml11TicketValidator) { configureSamlValidator(config, (Saml11TicketValidator) validator); } return new JasigAuthenticator(config, validator); }  static Authenticator newInstance(Configuration config,
      String proxyCallbackUrl, ProxyCallbackHandler proxyCallbackHandler); }
AuthenticatorFactory { public static Authenticator newInstance(Configuration config, String proxyCallbackUrl, ProxyCallbackHandler proxyCallbackHandler) { HttpsURLConnectionFactory connectionFactory = new HttpsURLConnectionFactory(config.getSslContext(), config.getHostnameVerifier()); TicketValidator validator = createTicketValidator(config, connectionFactory); if (validator instanceof Cas20ServiceTicketValidator) { configureServiceValidator(config, proxyCallbackUrl, proxyCallbackHandler, connectionFactory, (Cas20ServiceTicketValidator) validator); } if (validator instanceof Cas20ProxyTicketValidator) { configureProxyValidator(config, (Cas20ProxyTicketValidator) validator); } if (validator instanceof Saml11TicketValidator) { configureSamlValidator(config, (Saml11TicketValidator) validator); } return new JasigAuthenticator(config, validator); }  static Authenticator newInstance(Configuration config,
      String proxyCallbackUrl, ProxyCallbackHandler proxyCallbackHandler);  }