Class DefaultRedirectUriCreationFunctionTest
- java.lang.Object
-
- net.shibboleth.idp.plugin.authn.oidc.rp.impl.DefaultRedirectUriCreationFunctionTest
-
public class DefaultRedirectUriCreationFunctionTest extends Object
Tests forDefaultRedirectUriCreationFunction.
-
-
Field Summary
Fields Modifier and Type Field Description private static StringCALLBACK_PATHStatic callback path from servlet request.private net.shibboleth.idp.plugin.authn.oidc.rp.context.OAuth2ClientContextclientContextCreated client context.private ProfileRequestContextprcCreated PRC.private MockHttpServletRequestrequestHTTP request mock.private net.shibboleth.idp.plugin.authn.oidc.rp.impl.DefaultRedirectUriCreationFunctionstrategyThe action to test.
-
Constructor Summary
Constructors Constructor Description DefaultRedirectUriCreationFunctionTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetUp()voidtestComputedRedirectAllowed()Test redirect URI is allowed and built.voidtestComputedRedirectAllowedHTTPCustomPort()Test redirect URI is allowed and built using a custom HTTP port.voidtestComputedRedirectAllowedHTTPSCustomPort()Test redirect URI is allowed and built using a custom HTTPS port.voidtestComputedRedirectAllowedNullPort()Test redirect URI is allowed and built using a null port (assume the default).voidtestComputedRedirectBadHostname()Test redirect URI is disallowed and not built when using an injected, malicious, hostname header.voidtestComputedRedirectDisallowed()Test redirect URI is disallowed and not built.voidtestComputedRedirectDisallowedNotOrigins()Test redirect URI is disallowed on the origin.voidtestComputedRedirectDisallowedOnPort()Test redirect URI is disallowed on port.voidtestPreregisteredURL()Test redirect URI is allowed and built using a pre-registered URL.
-
-
-
Field Detail
-
CALLBACK_PATH
private static final String CALLBACK_PATH
Static callback path from servlet request.- See Also:
- Constant Field Values
-
strategy
private net.shibboleth.idp.plugin.authn.oidc.rp.impl.DefaultRedirectUriCreationFunction strategy
The action to test.
-
request
private MockHttpServletRequest request
HTTP request mock.
-
prc
private ProfileRequestContext prc
Created PRC.
-
clientContext
private net.shibboleth.idp.plugin.authn.oidc.rp.context.OAuth2ClientContext clientContext
Created client context.
-
-
Method Detail
-
testComputedRedirectAllowed
public final void testComputedRedirectAllowed() throws ExceptionTest redirect URI is allowed and built.- Throws:
Exception- on error
-
testComputedRedirectDisallowed
public final void testComputedRedirectDisallowed() throws ExceptionTest redirect URI is disallowed and not built.- Throws:
Exception- on error
-
testComputedRedirectDisallowedNotOrigins
public final void testComputedRedirectDisallowedNotOrigins() throws ExceptionTest redirect URI is disallowed on the origin.- Throws:
Exception- on error
-
testComputedRedirectAllowedHTTPSCustomPort
public final void testComputedRedirectAllowedHTTPSCustomPort() throws ExceptionTest redirect URI is allowed and built using a custom HTTPS port.- Throws:
Exception- on error
-
testComputedRedirectAllowedHTTPCustomPort
public final void testComputedRedirectAllowedHTTPCustomPort() throws ExceptionTest redirect URI is allowed and built using a custom HTTP port.- Throws:
Exception- on error
-
testComputedRedirectAllowedNullPort
public final void testComputedRedirectAllowedNullPort() throws ExceptionTest redirect URI is allowed and built using a null port (assume the default).- Throws:
Exception- on error
-
testComputedRedirectDisallowedOnPort
public final void testComputedRedirectDisallowedOnPort() throws ExceptionTest redirect URI is disallowed on port.- Throws:
Exception- on error
-
testPreregisteredURL
public final void testPreregisteredURL() throws ExceptionTest redirect URI is allowed and built using a pre-registered URL.- Throws:
Exception- on error
-
-