Class AuthorizationControllerTest

    • Field Detail

      • REDIRECT_URI

        @Nonnull
        private final String REDIRECT_URI
        The redirect to direct the user-agent to after successful authentication.
        See Also:
        Constant Field Values
      • mockMvc

        @Nonnull
        private MockMvc mockMvc
        The mock MVC entry point for testing.
      • servletContext

        @Nonnull
        @Autowired
        private javax.servlet.ServletContext servletContext
        The mock servlet context.
      • response

        @Nonnull
        @Autowired
        private javax.servlet.http.HttpServletResponse response
        The mock http servlet response.
      • request

        @Nonnull
        @Autowired
        private javax.servlet.http.HttpServletRequest request
        The mock http servlet request.
    • Constructor Detail

      • AuthorizationControllerTest

        public AuthorizationControllerTest()
    • Method Detail

      • setUp

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

        public void testSuccessfulAuthorizeRequest()
                                            throws Exception
        Test the correct 302 redirect is returned from the authorization controller.
        Throws:
        Exception - on error
      • testSuccessfulAuthorizeRequest_WithRequestObject

        public void testSuccessfulAuthorizeRequest_WithRequestObject()
                                                              throws Exception
        Test the correct 302 redirect is returned from the authorization controller. Including a Request Object.
        Throws:
        Exception - on error
      • addRequestObject

        private void addRequestObject​(@Nonnull
                                      net.shibboleth.oidc.profile.core.OIDCAuthenticationRequest request)
        Add a simple RequestObject JWT to the authentication request.
        Parameters:
        request - the authentication request
      • addPreEncodeMessageHandler

        private void addPreEncodeMessageHandler​(@Nonnull
                                                net.shibboleth.idp.plugin.authn.oidc.rp.context.OIDCAuthnContext authnContext)
                                         throws ComponentInitializationException
        Add the standard set of pre encode message handlers e.g. those to sign a request object if present.
        Parameters:
        authnContext - the authentication context
        Throws:
        ComponentInitializationException - on error
      • addSecurityParametersContext

        private void addSecurityParametersContext​(@Nonnull
                                                  ProfileRequestContext prc)
                                           throws Exception
        A a security parameters context, almost always for request object signing/encryption by this point.
        Parameters:
        prc - the profile request context
        Throws:
        Exception - on error
      • buildProfileRequestContext

        @Nonnull
        private ProfileRequestContext buildProfileRequestContext()
                                                          throws Exception
        Build a nested ProfileRequestContext by configuring a suitable context tree for external authentication e.g. a AuthenticationContext and ExternalAuthenticationContext. Nest the proxy PRC under the authentication context.
        Returns:
        a profile request context.
        Throws:
        Exception - on error creating the duo client
      • extractExternalAuthContext

        private net.shibboleth.idp.authn.context.ExternalAuthenticationContext extractExternalAuthContext()
        Create an external authentication context.
        Returns:
        external authentication context