Class ValidateRequestObjectTest
- java.lang.Object
-
- net.shibboleth.idp.plugin.oidc.op.profile.impl.ValidateRequestObjectTest
-
public class ValidateRequestObjectTest extends Object
ValidateRequestObjectunit test.
-
-
Field Summary
Fields Modifier and Type Field Description private net.shibboleth.idp.plugin.oidc.op.profile.impl.ValidateRequestObjectactionprivate Stringissuerprivate KeyPairkpprivate net.shibboleth.oidc.metadata.context.OIDCMetadataContextoidcCtxprivate OIDCAuthenticationResponseContextoidcRespCtxprivate ProfileRequestContextprcprivate RequestContextrequestCtx
-
Constructor Summary
Constructors Constructor Description ValidateRequestObjectTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected net.shibboleth.oidc.security.jwt.claims.impl.ChainingJWTClaimsValidatorbuildPlainClaimsValidation()protected net.shibboleth.oidc.security.jwt.claims.impl.ChainingJWTClaimsValidatorbuildSignedClaimsValidation(String clientId)voidsetup()voidtestInitFailsNoPlainValidator()voidtestInitFailsNoSignedValidators()voidtestInitFailsNoValidators()voidtestInitSuccess()voidtestPlainExpiredRequestObject()voidtestPlainNotBeforeInFutureRequestObject()voidtestRequestObjectAlgMatch()Test success case of having non signed request object and registered algorithm 'none'voidtestRequestObjectAlgMismatch()Test failure case of having non signed request object and registered algorithm other than 'none'voidtestRequestObjectClientMismatch()Test failure case of mismatch in client_id valuesvoidtestRequestObjectClientRespTypeMatch()Test success in case of matching client_id and response_type valuesvoidtestRequestObjectClientRespTypeMatchWithExpNbf()voidtestRequestObjectNoMatchingClaims()Test success in case of having non signed request object and no registered algorithmvoidtestRequestObjectRespTypeMismatch()Test failure in case of mismatch in response_type valuesvoidtestRequestObjectSignedNotVerified()Test case of signature not matching any key.voidtestRequestObjectSignedWithRS256()Test success case of RS256 signed request object.voidtestRequestObjectSignedWithRS256NoCredsInSecParams()Test signed request object but no credentials is sec params.voidtestRequestObjectSignedWithRS256NoSecParams()Test signed request object but no sec params.voidtestRequestObjectSignedWithRS256NoSecParamsCtxt()Test signed request object but no sec params context.voidtestRequestObjectSignedWithUnexpectedAlgorithm()Test case of request object signed with wrong type of algorithm.voidtestRequestObjectWithExpNbfSignedWithRS256()voidtestSignedExpiredRequestObject()voidtestSignedNoAudienceRequstObject()voidtestSignedNoIssuerRequstObject()voidtestSignedNotBeforeInFutureRequestObject()voidtestSignedWrongAudienceRequstObject()voidtestSignedWrongIssuerRequstObject()voidtestSuccessNoObject()Test that success in case of not having request object
-
-
-
Field Detail
-
prc
private ProfileRequestContext prc
-
action
private net.shibboleth.idp.plugin.oidc.op.profile.impl.ValidateRequestObject action
-
requestCtx
private RequestContext requestCtx
-
oidcCtx
private net.shibboleth.oidc.metadata.context.OIDCMetadataContext oidcCtx
-
oidcRespCtx
private OIDCAuthenticationResponseContext oidcRespCtx
-
kp
private KeyPair kp
-
issuer
private String issuer
-
-
Method Detail
-
setup
@BeforeMethod public void setup() throws ComponentInitializationException, NoSuchAlgorithmException
-
buildSignedClaimsValidation
protected net.shibboleth.oidc.security.jwt.claims.impl.ChainingJWTClaimsValidator buildSignedClaimsValidation(String clientId)
-
buildPlainClaimsValidation
protected net.shibboleth.oidc.security.jwt.claims.impl.ChainingJWTClaimsValidator buildPlainClaimsValidation()
-
testInitFailsNoValidators
public void testInitFailsNoValidators() throws ComponentInitializationException- Throws:
ComponentInitializationException
-
testInitFailsNoPlainValidator
public void testInitFailsNoPlainValidator() throws ComponentInitializationException- Throws:
ComponentInitializationException
-
testInitFailsNoSignedValidators
public void testInitFailsNoSignedValidators() throws ComponentInitializationException- Throws:
ComponentInitializationException
-
testInitSuccess
public void testInitSuccess() throws ComponentInitializationException- Throws:
ComponentInitializationException
-
testSuccessNoObject
public void testSuccessNoObject() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxExceptionTest that success in case of not having request object
-
testRequestObjectNoMatchingClaims
public void testRequestObjectNoMatchingClaims() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxExceptionTest success in case of having non signed request object and no registered algorithm
-
testRequestObjectAlgMismatch
public void testRequestObjectAlgMismatch() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxExceptionTest failure case of having non signed request object and registered algorithm other than 'none'
-
testRequestObjectAlgMatch
public void testRequestObjectAlgMatch() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxExceptionTest success case of having non signed request object and registered algorithm 'none'
-
testRequestObjectClientMismatch
public void testRequestObjectClientMismatch() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxExceptionTest failure case of mismatch in client_id values
-
testRequestObjectRespTypeMismatch
public void testRequestObjectRespTypeMismatch() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxExceptionTest failure in case of mismatch in response_type values
-
testRequestObjectClientRespTypeMatch
public void testRequestObjectClientRespTypeMatch() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxExceptionTest success in case of matching client_id and response_type values
-
testRequestObjectClientRespTypeMatchWithExpNbf
public void testRequestObjectClientRespTypeMatchWithExpNbf() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException
-
testRequestObjectSignedWithRS256
public void testRequestObjectSignedWithRS256() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterExceptionTest success case of RS256 signed request object.- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testRequestObjectWithExpNbfSignedWithRS256
public void testRequestObjectWithExpNbfSignedWithRS256() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterException- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testRequestObjectSignedNotVerified
public void testRequestObjectSignedNotVerified() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterExceptionTest case of signature not matching any key.- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testRequestObjectSignedWithUnexpectedAlgorithm
public void testRequestObjectSignedWithUnexpectedAlgorithm() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterExceptionTest case of request object signed with wrong type of algorithm.- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testRequestObjectSignedWithRS256NoSecParamsCtxt
public void testRequestObjectSignedWithRS256NoSecParamsCtxt() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterExceptionTest signed request object but no sec params context.- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testRequestObjectSignedWithRS256NoSecParams
public void testRequestObjectSignedWithRS256NoSecParams() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterExceptionTest signed request object but no sec params.- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testRequestObjectSignedWithRS256NoCredsInSecParams
public void testRequestObjectSignedWithRS256NoCredsInSecParams() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterExceptionTest signed request object but no credentials is sec params.- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testSignedExpiredRequestObject
public void testSignedExpiredRequestObject() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterException- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testSignedNotBeforeInFutureRequestObject
public void testSignedNotBeforeInFutureRequestObject() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterException- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testSignedNoIssuerRequstObject
public void testSignedNoIssuerRequstObject() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterException- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testSignedWrongIssuerRequstObject
public void testSignedWrongIssuerRequstObject() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterException- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testSignedNoAudienceRequstObject
public void testSignedNoAudienceRequstObject() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterException- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testSignedWrongAudienceRequstObject
public void testSignedWrongAudienceRequstObject() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterException- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testPlainExpiredRequestObject
public void testPlainExpiredRequestObject() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterException- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
testPlainNotBeforeInFutureRequestObject
public void testPlainNotBeforeInFutureRequestObject() throws NoSuchAlgorithmException, ComponentInitializationException, URISyntaxException, com.nimbusds.jose.JOSEException, InvalidAlgorithmParameterException- Throws:
NoSuchAlgorithmExceptionComponentInitializationExceptionURISyntaxExceptioncom.nimbusds.jose.JOSEExceptionInvalidAlgorithmParameterException
-
-