Class IssuedEncryptedJWTTest
- java.lang.Object
-
- org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
- net.shibboleth.idp.test.flows.AbstractFlowTest
-
- net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcFlowTest
-
- net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractIssuedJWTSecurityTest
-
- net.shibboleth.idp.plugin.oidc.op.profile.flow.IssuedEncryptedJWTTest
-
- All Implemented Interfaces:
Aware,ApplicationContextAware,org.testng.IHookable,org.testng.ITestNGListener
- Direct Known Subclasses:
RequestObjectJWETest
public class IssuedEncryptedJWTTest extends AbstractIssuedJWTSecurityTest
Tests for verifying that the JWT encryption issued by OP matches the expected configuration. OP may issue JWTs from authorize, token and userinfo endpoints, depending on the RP or resource metadata.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractIssuedJWTSecurityTest
AbstractIssuedJWTSecurityTest.JWT_FETCHING_TYPE
-
-
Field Summary
Fields Modifier and Type Field Description protected static List<com.nimbusds.jose.EncryptionMethod>ENCRYPTION_METHODSEnabled encryption methods to be iterated over in the tests.protected static List<com.nimbusds.jose.JWEAlgorithm>JWE_ALGORITHMSEnabled JWE algorithms to be iterated over in the tests.protected static List<com.nimbusds.jose.JWSAlgorithm>JWS_ALGORITHMSEnabled JWS algorithms to be iterated over in the tests.protected booleantestSignedJwt-
Fields inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractIssuedJWTSecurityTest
defaultClientId, defaultClientIdEncryptionEnforced, defaultClientSecret, defaultClientSecret64B, encryptionOptional, fetchingType
-
Fields inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcFlowTest
ecKey, END_STATE_ID, endStateId, flowId, rsaPrivateKey, rsaPublicKey, storageService
-
Fields inherited from class net.shibboleth.idp.test.flows.AbstractFlowTest
builderFactory, certFactoryBean, directoryServer, END_STATE_OUTPUT_ATTR_EXPR, END_STATE_OUTPUT_ATTR_NAME, externalContext, flowExecutor, idGenerator, IDP_ENTITY_ID, idpCredential, IP_ADDRESS_AUTHN_FLOW_ID, IP_ADDRESS_AUTHN_MAP_BEAN_NAME, KEYSTORE_FILE, LDIF_FILE, marshallerFactory, parserPool, request, response, SAML1_TRANSFORM_C14N_BEAN_NAME, SAML2_TRANSFORM_C14N_BEAN_NAME, SP_ACS_URL, SP_ENTITY_ID, SP_RELAY_STATE, spCredential, unmarshallerFactory
-
Fields inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
applicationContext, logger
-
-
Constructor Summary
Constructors Constructor Description IssuedEncryptedJWTTest(AbstractIssuedJWTSecurityTest.JWT_FETCHING_TYPE type, String flowId)IssuedEncryptedJWTTest(AbstractIssuedJWTSecurityTest.JWT_FETCHING_TYPE type, String flowId, boolean testSigned, boolean encryptionOptional)
-
Method Summary
-
Methods inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractIssuedJWTSecurityTest
assertAndDecryptJwt, assertEncryptedJwt, assertEncryptedSignedJwt, assertEncryptedSignedJwt, assertNoJwtResponse, assertNoJwtResponse, assertNoJwtResponse, assertSignedJwt, assertSignedJwt, assertSignedJwt, obtainAccessTokenFromAuthorizeEndpoint, obtainIdTokenFromAuthorizeEndpoint, obtainIdTokenFromTokenEndpoint, obtainJwt, obtainJwt, obtainJwt, obtainJwt, obtainJwtAccessTokenFromTokenEndpoint, obtainUserInfoAsJwt, obtainUserInfoResponse, obtainUserInfoResponse, parseEncryptedOrSignedJWT
-
Methods inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcFlowTest
assertErrorCode, assertErrorDescriptionContains, buildJsonForLegacyToken, buildJWKSet, buildMetadataSkeleton, buildToken, buildToken, buildToken, createEncryptedJWT, createEncryptedJWT, createEncryptedJWT, createPrivateKeyJWT, createPrivateKeyJWT, createPrivateKeyJWT, createSecretJWT, createSecretJWT, generateNewKeyPair, generateNewKeyPair, getDataSealer, initializeECKey, initializeMocks, initializeThreadLocals, initKeys, loadCredential, loadEncryptionCredential, loadES384SigningCredential, loadES512SigningCredential, loadESSigningCredential, loadRSSigningCredential, parseErrorResponse, parseResponse, parseSuccessResponse, removeMetadata, setBasicAuth, setHttpFormRequest, setHttpFormRequest, setJsonRequest, setRequest, setRequest, storeConsent, storeMetadata, storeMetadata, storeMetadata, storeMetadata, storeMetadata, storeMetadata, storeMetadata, storeMetadata, storeMetadata, storeMetadata, storeMetadata, storeMetadataObject
-
Methods inherited from class net.shibboleth.idp.test.flows.AbstractFlowTest
assertFlowExecutionOutcome, assertFlowExecutionOutcome, assertFlowExecutionResult, assertProfileRequestContext, buildSOAP11Envelope, clearThreadLocals, getFlow, initializeFlowExecutor, initializeXMLObjectSupport, overrideEndStateOutput, overrideEndStateOutput, registerFlowsInParentRegistry, retrieveProfileRequestContext, setupDirectoryServer, teardownDirectoryServer
-
Methods inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
run, setApplicationContext, springTestContextAfterTestClass, springTestContextAfterTestMethod, springTestContextBeforeTestClass, springTestContextBeforeTestMethod, springTestContextPrepareTestInstance
-
-
-
-
Field Detail
-
JWS_ALGORITHMS
protected static final List<com.nimbusds.jose.JWSAlgorithm> JWS_ALGORITHMS
Enabled JWS algorithms to be iterated over in the tests.
-
JWE_ALGORITHMS
protected static final List<com.nimbusds.jose.JWEAlgorithm> JWE_ALGORITHMS
Enabled JWE algorithms to be iterated over in the tests.
-
ENCRYPTION_METHODS
protected static final List<com.nimbusds.jose.EncryptionMethod> ENCRYPTION_METHODS
Enabled encryption methods to be iterated over in the tests.
-
testSignedJwt
protected final boolean testSignedJwt
-
-
Constructor Detail
-
IssuedEncryptedJWTTest
public IssuedEncryptedJWTTest(AbstractIssuedJWTSecurityTest.JWT_FETCHING_TYPE type, String flowId)
-
IssuedEncryptedJWTTest
public IssuedEncryptedJWTTest(AbstractIssuedJWTSecurityTest.JWT_FETCHING_TYPE type, String flowId, boolean testSigned, boolean encryptionOptional)
-
-
Method Detail
-
testJwtEncryption_noSigAlgNorEncSpecified
public void testJwtEncryption_noSigAlgNorEncSpecified() throws Exception- Throws:
Exception
-
getSignatureVerificationKey
protected static PublicKey getSignatureVerificationKey(com.nimbusds.jose.JWSAlgorithm jwsAlgorithm)
-
getSigningKey
protected static PrivateKey getSigningKey(com.nimbusds.jose.JWSAlgorithm jwsAlgorithm)
-
assertSecretBasedEncryption
protected void assertSecretBasedEncryption(com.nimbusds.jose.JWEAlgorithm jweAlgorithm, com.nimbusds.jose.EncryptionMethod method)
-
testJwtEncryption_a128kwWithEnabledMethods
public void testJwtEncryption_a128kwWithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_a128kwWithExcludedMethod
public void testJwtEncryption_a128kwWithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_a192kwWithEnabledMethods
public void testJwtEncryption_a192kwWithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_a192kwWithExcludedMethod
public void testJwtEncryption_a192kwWithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_a256kwWithEnabledMethods
public void testJwtEncryption_a256kwWithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_a256kwWithExcludedMethod
public void testJwtEncryption_a256kwWithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_a128gcmkwWithEnabledMethods
public void testJwtEncryption_a128gcmkwWithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_a128gcmkwWithExcludedMethod
public void testJwtEncryption_a128gcmkwWithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_a192gcmkwWithEnabledMethods
public void testJwtEncryption_a192gcmkwWithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_a192gcmkwWithExcludedMethod
public void testJwtEncryption_a192gcmkwWithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_a256gcmkwWithEnabledMethods
public void testJwtEncryption_a256gcmkwWithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_a256gcmkwWithExcludedMethod
public void testJwtEncryption_a256gcmkwWithExcludedMethod() throws Exception- Throws:
Exception
-
assertNoSymmetricKeyResponse
protected void assertNoSymmetricKeyResponse(com.nimbusds.jose.JWEAlgorithm jweAlgorithm, com.nimbusds.jose.EncryptionMethod method) throws Exception- Throws:
Exception
-
testJwtEncryption_symmetricKeyEncryption_noKey
public void testJwtEncryption_symmetricKeyEncryption_noKey() throws Exception- Throws:
Exception
-
assertPublicKeyBasedEncryption
protected void assertPublicKeyBasedEncryption(PublicKey publicKey, PrivateKey privateKey, com.nimbusds.jose.JWEAlgorithm jweAlgorithm, com.nimbusds.jose.EncryptionMethod method)
-
testJwtEncryption_ecdhWithEnabledMethods
public void testJwtEncryption_ecdhWithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_ecdhWithExcludedMethod
public void testJwtEncryption_ecdhWithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_ecdh128kwWithEnabledMethods
public void testJwtEncryption_ecdh128kwWithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_ecdh128kwWithExcludedMethod
public void testJwtEncryption_ecdh128kwWithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_ecdh192kwWithEnabledMethods
public void testJwtEncryption_ecdh192kwWithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_ecdh192kwWithExcludedMethod
public void testJwtEncryption_ecdh192kwWithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_ecdh256kwWithEnabledMethods
public void testJwtEncryption_ecdh256kwWithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_ecdh256kwWithExcludedMethod
public void testJwtEncryption_ecdh256kwWithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_rsa15WithEnabledMethods
public void testJwtEncryption_rsa15WithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_rsa15WithExcludedMethod
public void testJwtEncryption_rsa15WithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_rsaOaepWithEnabledMethods
public void testJwtEncryption_rsaOaepWithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_rsaOaepWithExcludedMethod
public void testJwtEncryption_rsaOaepWithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_rsaOaep256WithEnabledMethods
public void testJwtEncryption_rsaOaep256WithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_rsaOaep256WithExcludedMethod
public void testJwtEncryption_rsaOaep256WithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_rsaOaep384WithEnabledMethods
public void testJwtEncryption_rsaOaep384WithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_rsaOaep384WithExcludedMethod
public void testJwtEncryption_rsaOaep384WithExcludedMethod() throws Exception- Throws:
Exception
-
testJwtEncryption_rsaOaep512WithEnabledMethods
public void testJwtEncryption_rsaOaep512WithEnabledMethods() throws Exception- Throws:
Exception
-
testJwtEncryption_rsaOaep512WithExcludedMethod
public void testJwtEncryption_rsaOaep512WithExcludedMethod() throws Exception- Throws:
Exception
-
assertExcludedAlgorithm
protected void assertExcludedAlgorithm(com.nimbusds.jose.JWEAlgorithm jweAlgorithm, com.nimbusds.jose.EncryptionMethod method) throws Exception- Throws:
Exception
-
assertNoPublicKeyResponse
protected void assertNoPublicKeyResponse(com.nimbusds.jose.JWEAlgorithm jweAlgorithm, com.nimbusds.jose.EncryptionMethod method) throws Exception- Throws:
Exception
-
-