Class RevocationFlowTest
- 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.AbstractOidcApiFlowTest
-
- net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcClientAuthenticationFlowTest
-
- net.shibboleth.idp.plugin.oidc.op.profile.flow.RevocationFlowTest
-
- All Implemented Interfaces:
Aware,ApplicationContextAware,IHookable,ITestNGListener
public class RevocationFlowTest extends AbstractOidcClientAuthenticationFlowTest
Unit tests for the OAuth2 revocation flow.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) StringclientIdSinglestatic StringFLOW_ID(package private) RevocationCacherevocationCache(package private) com.nimbusds.oauth2.sdk.Scopescopeprivate net.shibboleth.oidc.security.credential.JWKCredentialsigningKey(package private) StorageServicestorageService-
Fields inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcClientAuthenticationFlowTest
clientId, clientIdSaml, clientSecret, clientSecretSaml, jwtAud, rsaPrivateKey, rsaPublicKey
-
Fields inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcFlowTest
END_STATE_ID
-
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 RevocationFlowTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertSuccessResponse(FlowExecutionResult result)Verify that the given result is a success response.protected Pair<String,String>getErrorDetaisForJWTValidation()Get the pair of error code and error description for the error produced via eventEventIds.ACCESS_DENIED.protected FlowExecutionResultlaunchWithJwtAuthentication(com.nimbusds.jwt.SignedJWT jwt, com.nimbusds.jose.JWSAlgorithm algorithm, com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod method)Launch the flow with the JWT client authentication method.voidtearDown()voidtestFailedAuthentication()voidtestSuccess()voidtestSuccessJWTAudience()voidtestSuccessJWTExpired()voidtestSuccessJWTNoAudience()voidtestSuccessJWTNotAuthorized()voidtestSuccessJWTWrongKey()voidtestSuccessSingleAccessToken()voidtestSuccessSingleRefreshToken()voidtestSuccessUnverified()voidtestSuccessWithLegacyConsentToken()voidtestSuccessWithLegacyToken()voidtestSuccessWithSamlMetadata()voidtestUntrustedClient()-
Methods inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcClientAuthenticationFlowTest
buildPrivateKeyJwtAuth, buildSecretJwtAuth, claimsSetExpiredExp, claimsSetIssuedInTheFuture, claimsSetMissingAud, claimsSetMissingExp, claimsSetMissingIss, claimsSetMissingJti, claimsSetMissingSub, initKeys, populateClientAssertionParams, populateClientAssertionParams, testInvalidPrivateKeyJWT_expiredExp, testInvalidPrivateKeyJWT_issuedInTheFuture, testInvalidPrivateKeyJWT_missingAud, testInvalidPrivateKeyJWT_missingExp, testInvalidPrivateKeyJWT_missingIss, testInvalidPrivateKeyJWT_missingJti, testInvalidPrivateKeyJWT_missingSub, testInvalidPrivateKeyJWT_replayJti, testInvalidSecretJWT_expiredExp, testInvalidSecretJWT_issuedInTheFuture, testInvalidSecretJWT_missingAud, testInvalidSecretJWT_missingExp, testInvalidSecretJWT_missingIss, testInvalidSecretJWT_missingJti, testInvalidSecretJWT_missingSub, testInvalidSecretJWT_replayJti, testValidPrivateKeyJWT, testValidSecretJWT, validClaimsSet
-
Methods inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcApiFlowTest
buildJWTToken, buildJWTToken, buildLegacyToken, buildLegacyToken, buildRefreshToken, buildToken, buildToken, buildToken
-
Methods inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcFlowTest
assertErrorCode, assertErrorDescriptionContains, buildJsonForLegacyToken, createPrivateKeyJWT, createSecretJWT, getDataSealer, initializeMocks, initializeThreadLocals, parseErrorResponse, parseResponse, parseSuccessResponse, removeMetadata, setBasicAuth, setHttpFormRequest, setJsonRequest, setRequest, storeConsent, storeMetadata, storeMetadata, storeMetadata, storeMetadata, storeMetadata
-
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
-
FLOW_ID
public static final String FLOW_ID
- See Also:
- Constant Field Values
-
clientIdSingle
String clientIdSingle
-
scope
com.nimbusds.oauth2.sdk.Scope scope
-
signingKey
@Autowired @Qualifier("testbed.DefaultRSSigningCredential") private net.shibboleth.oidc.security.credential.JWKCredential signingKey
-
storageService
@Autowired @Qualifier("shibboleth.StorageService") StorageService storageService
-
revocationCache
@Autowired @Qualifier("shibboleth.oidc.RevocationCache") RevocationCache revocationCache
-
-
Method Detail
-
tearDown
@AfterMethod public void tearDown() throws IOException
- Throws:
IOException
-
testUntrustedClient
public void testUntrustedClient() throws IOException, NoSuchAlgorithmException, URISyntaxException, DataSealerException, ComponentInitializationException
-
testFailedAuthentication
public void testFailedAuthentication() throws IOException, NoSuchAlgorithmException, URISyntaxException, DataSealerException, ComponentInitializationException
-
testSuccessUnverified
public void testSuccessUnverified() throws IOException, NoSuchAlgorithmException, URISyntaxException, DataSealerException, ComponentInitializationException
-
testSuccess
public void testSuccess() throws IOException, NoSuchAlgorithmException, URISyntaxException, DataSealerException, ComponentInitializationException
-
testSuccessSingleAccessToken
public void testSuccessSingleAccessToken() throws IOException, NoSuchAlgorithmException, URISyntaxException, DataSealerException, ComponentInitializationException
-
testSuccessSingleRefreshToken
public void testSuccessSingleRefreshToken() throws IOException, NoSuchAlgorithmException, URISyntaxException, DataSealerException, ComponentInitializationException
-
testSuccessWithSamlMetadata
public void testSuccessWithSamlMetadata() throws NoSuchAlgorithmException, URISyntaxException, DataSealerException, ComponentInitializationException
-
testSuccessWithLegacyToken
public void testSuccessWithLegacyToken() throws IOException, NoSuchAlgorithmException, URISyntaxException, DataSealerException, ComponentInitializationException, com.nimbusds.oauth2.sdk.ParseException- Throws:
IOExceptionNoSuchAlgorithmExceptionURISyntaxExceptionDataSealerExceptionComponentInitializationExceptioncom.nimbusds.oauth2.sdk.ParseException
-
testSuccessWithLegacyConsentToken
public void testSuccessWithLegacyConsentToken() throws IOException, NoSuchAlgorithmException, URISyntaxException, DataSealerException, ComponentInitializationException, com.nimbusds.oauth2.sdk.ParseException- Throws:
IOExceptionNoSuchAlgorithmExceptionURISyntaxExceptionDataSealerExceptionComponentInitializationExceptioncom.nimbusds.oauth2.sdk.ParseException
-
launchWithJwtAuthentication
protected FlowExecutionResult launchWithJwtAuthentication(com.nimbusds.jwt.SignedJWT jwt, com.nimbusds.jose.JWSAlgorithm algorithm, com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod method) throws Exception
Description copied from class:AbstractOidcClientAuthenticationFlowTestLaunch the flow with the JWT client authentication method.- Specified by:
launchWithJwtAuthenticationin classAbstractOidcClientAuthenticationFlowTest- Parameters:
jwt- The JWT to be used for client authentication.algorithm- The algorithm to be used in the client authentication.method- The client authentication method.- Returns:
- The flow execution result.
- Throws:
Exception
-
getErrorDetaisForJWTValidation
protected Pair<String,String> getErrorDetaisForJWTValidation()
Description copied from class:AbstractOidcClientAuthenticationFlowTestGet the pair of error code and error description for the error produced via eventEventIds.ACCESS_DENIED. This is abstract due to the fact that each endpoint may have its own mappings.- Specified by:
getErrorDetaisForJWTValidationin classAbstractOidcClientAuthenticationFlowTest- Returns:
- The pair of error code and error description.
-
testSuccessJWTNoAudience
public void testSuccessJWTNoAudience() throws com.nimbusds.jose.JOSEException, IOException- Throws:
com.nimbusds.jose.JOSEExceptionIOException
-
testSuccessJWTAudience
public void testSuccessJWTAudience() throws com.nimbusds.jose.JOSEException, IOException- Throws:
com.nimbusds.jose.JOSEExceptionIOException
-
testSuccessJWTExpired
public void testSuccessJWTExpired() throws com.nimbusds.jose.JOSEException, IOException- Throws:
com.nimbusds.jose.JOSEExceptionIOException
-
testSuccessJWTNotAuthorized
public void testSuccessJWTNotAuthorized() throws com.nimbusds.jose.JOSEException, IOException- Throws:
com.nimbusds.jose.JOSEExceptionIOException
-
testSuccessJWTWrongKey
public void testSuccessJWTWrongKey() throws com.nimbusds.jose.JOSEException, IOException- Throws:
com.nimbusds.jose.JOSEExceptionIOException
-
assertSuccessResponse
protected void assertSuccessResponse(FlowExecutionResult result)
Description copied from class:AbstractOidcClientAuthenticationFlowTestVerify that the given result is a success response.- Specified by:
assertSuccessResponsein classAbstractOidcClientAuthenticationFlowTest- Parameters:
result- The flow execution result to be verified.
-
-