Class SPNEGOAuthnControllerTest
- java.lang.Object
-
- net.shibboleth.idp.authn.spnego.impl.SPNEGOAuthnControllerTest
-
public class SPNEGOAuthnControllerTest extends Object
-
-
Field Summary
Fields Modifier and Type Field Description private net.shibboleth.idp.authn.spnego.impl.SPNEGOAuthnControllercontrollerprivate net.shibboleth.idp.authn.spnego.impl.SPNEGOAuthnControllermockedGSSControllerprivate net.shibboleth.idp.authn.spnego.impl.GSSContextAcceptormockGSSContextAcceptorprivate static StringNEGOTIATE_HEADER_DATAprivate static StringNTLMSSP_HEADER_DATAprivate static StringTEST_CONVERSATION_KEY
-
Constructor Summary
Constructors Constructor Description SPNEGOAuthnControllerTest()
-
Method Summary
-
-
-
Field Detail
-
TEST_CONVERSATION_KEY
private static final String TEST_CONVERSATION_KEY
- See Also:
- Constant Field Values
-
NTLMSSP_HEADER_DATA
private static String NTLMSSP_HEADER_DATA
-
NEGOTIATE_HEADER_DATA
private static String NEGOTIATE_HEADER_DATA
-
controller
private net.shibboleth.idp.authn.spnego.impl.SPNEGOAuthnController controller
-
mockGSSContextAcceptor
private net.shibboleth.idp.authn.spnego.impl.GSSContextAcceptor mockGSSContextAcceptor
-
mockedGSSController
private net.shibboleth.idp.authn.spnego.impl.SPNEGOAuthnController mockedGSSController
-
-
Method Detail
-
init
@BeforeClass public void init() throws net.shibboleth.utilities.java.support.codec.EncodingException
- Throws:
net.shibboleth.utilities.java.support.codec.EncodingException
-
setup
@BeforeMethod public void setup()
-
withoutConversationKeyParameter_startSPNEGO_shouldThrowExternalAuthenticationException
public void withoutConversationKeyParameter_startSPNEGO_shouldThrowExternalAuthenticationException() throws Exception- Throws:
Exception
-
givenMismatchedKeys_startSPNEGO_shouldThrowExternalAuthenticationException
public void givenMismatchedKeys_startSPNEGO_shouldThrowExternalAuthenticationException() throws Exception- Throws:
Exception
-
givenNullKey_startSPNEGO_shouldReturnAuthenticationException
public void givenNullKey_startSPNEGO_shouldReturnAuthenticationException() throws Exception- Throws:
Exception
-
withoutSPNEGOContext_startSPNEGO_shouldReturnAuthenticationError
public void withoutSPNEGOContext_startSPNEGO_shouldReturnAuthenticationError() throws Exception- Throws:
Exception
-
withoutKerberosSettings_startSPNEGO_shouldReturnAuthenticationError
public void withoutKerberosSettings_startSPNEGO_shouldReturnAuthenticationError() throws Exception- Throws:
Exception
-
givenKerberosSettings_startSPNEGO_shouldReturnModelAndView
public void givenKerberosSettings_startSPNEGO_shouldReturnModelAndView() throws Exception- Throws:
Exception
-
givenKerberosSettings_startSPNEGO_shouldPreserveQueryString
public void givenKerberosSettings_startSPNEGO_shouldPreserveQueryString() throws Exception- Throws:
Exception
-
givenKerberosSettings_startSPNEGO_shouldReplyUnauthorizedNegotiate
public void givenKerberosSettings_startSPNEGO_shouldReplyUnauthorizedNegotiate() throws Exception- Throws:
Exception
-
withoutNegotiateToken_continueSPNEGO_shouldReturnModelAndView
public void withoutNegotiateToken_continueSPNEGO_shouldReturnModelAndView() throws Exception- Throws:
Exception
-
withoutNegotiateToken_continueSPNEGO_shouldPreserveQueryString
public void withoutNegotiateToken_continueSPNEGO_shouldPreserveQueryString() throws Exception- Throws:
Exception
-
withoutNegotiateToken_continueSPNEGO_shouldReplyUnauthorizedNegotiate
public void withoutNegotiateToken_continueSPNEGO_shouldReplyUnauthorizedNegotiate() throws Exception- Throws:
Exception
-
withoutSPNEGOContext_continueSPNEGO_shouldReturnAuthenticationError
public void withoutSPNEGOContext_continueSPNEGO_shouldReturnAuthenticationError() throws Exception- Throws:
Exception
-
withoutKerberosSettings_continueSPNEGO_shouldReturnAuthenticationError
public void withoutKerberosSettings_continueSPNEGO_shouldReturnAuthenticationError() throws Exception- Throws:
Exception
-
givenFailedGSSContextAcceptorInstantiation_continueSPNEGO_shouldReturnAuthenticationException
public void givenFailedGSSContextAcceptorInstantiation_continueSPNEGO_shouldReturnAuthenticationException() throws Exception- Throws:
Exception
-
givenSuccessfulGSSContextAcceptorInstantiation_continueSPNEGO_shouldHaveSetAcceptorInSPNEGOContext
public void givenSuccessfulGSSContextAcceptorInstantiation_continueSPNEGO_shouldHaveSetAcceptorInSPNEGOContext() throws Exception- Throws:
Exception
-
givenHeaderAuthorizationNegotiate_withNTLMdata_continueSPNEGO_shouldReturnAuthenticationError
public void givenHeaderAuthorizationNegotiate_withNTLMdata_continueSPNEGO_shouldReturnAuthenticationError() throws Exception- Throws:
Exception
-
whenAcceptSecContextThrowsException_continueSPNEGO_shouldReturnAuthenticationException
public void whenAcceptSecContextThrowsException_continueSPNEGO_shouldReturnAuthenticationException() throws Exception- Throws:
Exception
-
withoutGSSContext_continueSPNEGO_shouldReturnModelAndView
public void withoutGSSContext_continueSPNEGO_shouldReturnModelAndView() throws Exception- Throws:
Exception
-
withoutGSSContext_continueSPNEGO_shouldReplyUnauthorizedNegotiate
public void withoutGSSContext_continueSPNEGO_shouldReplyUnauthorizedNegotiate() throws Exception- Throws:
Exception
-
givenGSSContextNotEstablished_continueSPNEGO_shouldReturnModelAndView
public void givenGSSContextNotEstablished_continueSPNEGO_shouldReturnModelAndView() throws Exception- Throws:
Exception
-
givenGSSContextNotEstablished_continueSPNEGO_shouldReplyUnauthorizedNegotiate
public void givenGSSContextNotEstablished_continueSPNEGO_shouldReplyUnauthorizedNegotiate() throws Exception- Throws:
Exception
-
givenGSSContextEstablished_andGSSException_continueSPNEGO_shouldReturnAuthenticationError
public void givenGSSContextEstablished_andGSSException_continueSPNEGO_shouldReturnAuthenticationError() throws Exception- Throws:
Exception
-
givenGSSContextEstablished_continueSPNEGO_shouldReturnNull
public void givenGSSContextEstablished_continueSPNEGO_shouldReturnNull() throws Exception- Throws:
Exception
-
givenGSSContextEstablished_continueSPNEGO_shouldSetAuthenticationSubjectAttribute
public void givenGSSContextEstablished_continueSPNEGO_shouldSetAuthenticationSubjectAttribute() throws Exception- Throws:
Exception
-
givenGSSContextEstablishedButNoGSSNameIsNull_continueSPNEGO_shouldSetAuthenticationSubjectAttribute
public void givenGSSContextEstablishedButNoGSSNameIsNull_continueSPNEGO_shouldSetAuthenticationSubjectAttribute() throws Exception- Throws:
Exception
-
buildSPNEGORequestContext
private RequestContext buildSPNEGORequestContext(String negotiateHeaderData) throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
- Throws:
net.shibboleth.utilities.java.support.component.ComponentInitializationException
-
buildKerberosContextRequestContext
private RequestContext buildKerberosContextRequestContext() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
- Throws:
net.shibboleth.utilities.java.support.component.ComponentInitializationException
-
buildKerberosProfileRequestContext
private org.opensaml.profile.context.ProfileRequestContext buildKerberosProfileRequestContext(RequestContext rc)
-
buildConversationRequestContext
private RequestContext buildConversationRequestContext(String conversationKey) throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
- Throws:
net.shibboleth.utilities.java.support.component.ComponentInitializationException
-
assertAuthenticationError
private void assertAuthenticationError(RequestContext request, ModelAndView mv, String expectedError)
-
assertAuthenticationExceptionCause
private void assertAuthenticationExceptionCause(RequestContext request, ModelAndView mv, Class<?> exceptedExceptionClass)
-
assertModelAndView
private void assertModelAndView(ModelAndView modelAndView, RequestContext request)
-
assertResponseUnauthorizedNegotiate
private void assertResponseUnauthorizedNegotiate(RequestContext request)
-
assertResponseUnauthorizedNegotiate
private void assertResponseUnauthorizedNegotiate(RequestContext request, String base64token)
-
-