Search in sources :

Example 6 with DynamicHtmlView

use of org.apereo.cas.web.view.DynamicHtmlView in project cas by apereo.

the class DefaultDelegatedAuthenticationNavigationControllerTests method verifyRedirectByAttr.

@Test
public void verifyRedirectByAttr() {
    val request = new MockHttpServletRequest();
    request.setAttribute(Pac4jConstants.DEFAULT_CLIENT_NAME_PARAMETER, "SAML2Client");
    val response = new MockHttpServletResponse();
    assertTrue(controller.redirectToProvider(request, response) instanceof DynamicHtmlView);
}
Also used : lombok.val(lombok.val) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) DynamicHtmlView(org.apereo.cas.web.view.DynamicHtmlView) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 7 with DynamicHtmlView

use of org.apereo.cas.web.view.DynamicHtmlView in project cas by apereo.

the class DefaultDelegatedAuthenticationNavigationControllerTests method verifyRedirectByAttrForceAuth.

@Test
public void verifyRedirectByAttrForceAuth() {
    val request = new MockHttpServletRequest();
    request.setAttribute(Pac4jConstants.DEFAULT_CLIENT_NAME_PARAMETER, "SAML2Client");
    request.setParameter(RedirectionActionBuilder.ATTRIBUTE_FORCE_AUTHN, "true");
    val response = new MockHttpServletResponse();
    assertTrue(controller.redirectToProvider(request, response) instanceof DynamicHtmlView);
}
Also used : lombok.val(lombok.val) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) DynamicHtmlView(org.apereo.cas.web.view.DynamicHtmlView) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

DynamicHtmlView (org.apereo.cas.web.view.DynamicHtmlView)7 lombok.val (lombok.val)6 Test (org.junit.jupiter.api.Test)5 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)5 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)5 RedirectView (org.springframework.web.servlet.view.RedirectView)2 URIBuilder (org.apache.http.client.utils.URIBuilder)1 DefaultRegisteredServiceProperty (org.apereo.cas.services.DefaultRegisteredServiceProperty)1 UnauthorizedServiceException (org.apereo.cas.services.UnauthorizedServiceException)1 Ticket (org.apereo.cas.ticket.Ticket)1 URIBuilder (org.jasig.cas.client.util.URIBuilder)1 IndirectClient (org.pac4j.core.client.IndirectClient)1 J2EContext (org.pac4j.core.context.J2EContext)1 HttpAction (org.pac4j.core.exception.HttpAction)1 WithContentAction (org.pac4j.core.exception.http.WithContentAction)1 WithLocationAction (org.pac4j.core.exception.http.WithLocationAction)1 RedirectAction (org.pac4j.core.redirect.RedirectAction)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1 View (org.springframework.web.servlet.View)1