public virtual void TestAuthenticationAnonymousDisallowed() { AuthenticatorTestCase auth = new AuthenticatorTestCase(); AuthenticatorTestCase.SetAuthenticationHandlerConfig(GetAuthenticationHandlerConfiguration (false)); auth._testAuthentication(new PseudoAuthenticator(), false); }
public virtual void TestAuthenticationAnonymousAllowedWithPost() { AuthenticatorTestCase auth = new AuthenticatorTestCase(); AuthenticatorTestCase.SetAuthenticationHandlerConfig(GetAuthenticationHandlerConfiguration (true)); auth._testAuthentication(new PseudoAuthenticator(), true); }
/// <exception cref="System.Exception"/> public virtual void TestAuthenticationHttpClientPost() { AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.SetAuthenticationHandlerConfig(GetAuthenticationHandlerConfiguration ()); KerberosTestUtils.DoAsClient(new _Callable_157(auth)); }
/// <exception cref="System.Exception"/> public virtual void TestFallbacktoPseudoAuthenticatorAnonymous() { AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); Properties props = new Properties(); props.SetProperty(AuthenticationFilter.AuthType, "simple"); props.SetProperty(PseudoAuthenticationHandler.AnonymousAllowed, "true"); AuthenticatorTestCase.SetAuthenticationHandlerConfig(props); auth._testAuthentication(new KerberosAuthenticator(), false); }
public virtual void TestAnonymousAllowed() { AuthenticatorTestCase auth = new AuthenticatorTestCase(); AuthenticatorTestCase.SetAuthenticationHandlerConfig(GetAuthenticationHandlerConfiguration (true)); auth.Start(); try { Uri url = new Uri(auth.GetBaseURL()); HttpURLConnection conn = (HttpURLConnection)url.OpenConnection(); conn.Connect(); Assert.Equal(HttpURLConnection.HttpOk, conn.GetResponseCode()); } finally { auth.Stop(); } }
/// <exception cref="System.Exception"/> public virtual void TestNotAuthenticated() { AuthenticatorTestCase auth = new AuthenticatorTestCase(useTomcat); AuthenticatorTestCase.SetAuthenticationHandlerConfig(GetAuthenticationHandlerConfiguration ()); auth.Start(); try { Uri url = new Uri(auth.GetBaseURL()); HttpURLConnection conn = (HttpURLConnection)url.OpenConnection(); conn.Connect(); Assert.Equal(HttpURLConnection.HttpUnauthorized, conn.GetResponseCode ()); Assert.True(conn.GetHeaderField(KerberosAuthenticator.WwwAuthenticate ) != null); } finally { auth.Stop(); } }
public virtual void TestAnonymousDisallowed() { AuthenticatorTestCase auth = new AuthenticatorTestCase(); AuthenticatorTestCase.SetAuthenticationHandlerConfig(GetAuthenticationHandlerConfiguration (false)); auth.Start(); try { Uri url = new Uri(auth.GetBaseURL()); HttpURLConnection conn = (HttpURLConnection)url.OpenConnection(); conn.Connect(); Assert.Equal(HttpURLConnection.HttpUnauthorized, conn.GetResponseCode ()); Assert.True(conn.GetHeaderFields().Contains("WWW-Authenticate") ); Assert.Equal("Authentication required", conn.GetResponseMessage ()); } finally { auth.Stop(); } }
public _Callable_157(AuthenticatorTestCase auth) { this.auth = auth; }