Class DuoOIDCAuthnControllerTest

    • Constructor Detail

      • DuoOIDCAuthnControllerTest

        public DuoOIDCAuthnControllerTest()
    • Method Detail

      • setUp

        @BeforeMethod
        public void setUp()
                   throws Exception
        Setup.
        Throws:
        Exception - on error.
      • testSuccessfulAuthorizeRequest

        public void testSuccessfulAuthorizeRequest()
                                            throws Exception
        Start a Duo 2FA request.
        Throws:
        Exception - on exception.
      • testIncorrectStateNoExecutionKey

        public void testIncorrectStateNoExecutionKey()
                                              throws Exception
        Checks that a state response with no key component triggers and error.
        Throws:
        Exception - on exception.
      • testIncorrectStateNoNonce

        public void testIncorrectStateNoNonce()
                                       throws Exception
        Checks that a state response with no nonce component triggers and error.
        Throws:
        Exception - on exception.
      • testSuccessfulCallback

        public void testSuccessfulCallback()
                                    throws Exception
        Ensure the 2FA end controller adds the correct Duo response information into the Duo authentication context.
        Throws:
        Exception - on exception.
      • testCallbackNoDuoAuthenticationContext

        public void testCallbackNoDuoAuthenticationContext()
                                                    throws Exception
        Remove the Duo authentication context from the authentication context and check the controller encodes an error as a http request attribute when ending a 2FA request.
        Throws:
        Exception - on exception.
      • testCallbackNoCode

        public void testCallbackNoCode()
                                throws Exception
        Test an exception is thrown if the callback does not contain an auth_code parameter.
        Throws:
        Exception - on exception.
      • testCallbackNoState

        public void testCallbackNoState()
                                 throws Exception
        Test an exception is thrown if the callback does not contain a state parameter.
        Throws:
        Exception - on exception.
      • removeDuoContext

        private void removeDuoContext()
        Remove the Duo authentication context from the profile request context.
      • extractDuoContext

        @Nonnull
        private net.shibboleth.idp.plugin.authn.duo.context.DuoOIDCAuthenticationContext extractDuoContext()
        Extract the DuoOIDCAuthenticationContext from the ProfileRequestContext ultimately stored in the ServletContext.
        Returns:
        the Duo authentication context extracted from the profile request context.