Class AbstractOidcApiFlowTest
- 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
-
- All Implemented Interfaces:
Aware,ApplicationContextAware,org.testng.IHookable,org.testng.ITestNGListener
- Direct Known Subclasses:
AbstractOidcClientAuthenticationFlowTest,UserInfoTest
public class AbstractOidcApiFlowTest extends AbstractOidcFlowTest
Abstract unit test for the OIDC flows using access tokens.
-
-
Field Summary
-
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 Modifier Constructor Description protectedAbstractOidcApiFlowTest(String flowId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.nimbusds.oauth2.sdk.token.BearerAccessTokenbuildJWTToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, Collection<String> audience, PrivateKey key, String alg)protected com.nimbusds.oauth2.sdk.token.BearerAccessTokenbuildJWTToken(AccessTokenClaimsSet claims, PrivateKey key, String alg)protected com.nimbusds.oauth2.sdk.token.BearerAccessTokenbuildLegacyToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.openid.connect.sdk.claims.ClaimsSet userInfoDeliverySet, String... consentedClaims)protected com.nimbusds.oauth2.sdk.token.BearerAccessTokenbuildLegacyToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, String... consentedClaims)protected com.nimbusds.oauth2.sdk.token.RefreshTokenbuildRefreshToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.openid.connect.sdk.claims.ClaimsSet userInfoDeliverySet, String id, String rootId)protected com.nimbusds.oauth2.sdk.token.RefreshTokenbuildRefreshToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.openid.connect.sdk.claims.ClaimsSet userInfoDeliverySet, String id, String rootId, Instant authTime, Instant chainExp)private com.nimbusds.jose.JWSSignergetSigner(PrivateKey key, com.nimbusds.jose.Algorithm jwsAlgorithm)Returns correct implementation of signer based on algorithm type.-
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
-
-
-
-
Constructor Detail
-
AbstractOidcApiFlowTest
protected AbstractOidcApiFlowTest(String flowId)
-
-
Method Detail
-
buildLegacyToken
protected com.nimbusds.oauth2.sdk.token.BearerAccessToken buildLegacyToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, String... consentedClaims) throws URISyntaxException, NoSuchAlgorithmException, DataSealerException, ComponentInitializationException
-
buildRefreshToken
protected com.nimbusds.oauth2.sdk.token.RefreshToken buildRefreshToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.openid.connect.sdk.claims.ClaimsSet userInfoDeliverySet, String id, String rootId) throws URISyntaxException, NoSuchAlgorithmException, DataSealerException, ComponentInitializationException
-
buildRefreshToken
protected com.nimbusds.oauth2.sdk.token.RefreshToken buildRefreshToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.openid.connect.sdk.claims.ClaimsSet userInfoDeliverySet, String id, String rootId, Instant authTime, Instant chainExp) throws URISyntaxException, NoSuchAlgorithmException, DataSealerException, ComponentInitializationException
-
buildLegacyToken
protected com.nimbusds.oauth2.sdk.token.BearerAccessToken buildLegacyToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.openid.connect.sdk.claims.ClaimsSet userInfoDeliverySet, String... consentedClaims) throws URISyntaxException, NoSuchAlgorithmException, DataSealerException, ComponentInitializationException
-
buildJWTToken
protected com.nimbusds.oauth2.sdk.token.BearerAccessToken buildJWTToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, Collection<String> audience, PrivateKey key, String alg) throws com.nimbusds.jose.JOSEException
- Throws:
com.nimbusds.jose.JOSEException
-
buildJWTToken
protected com.nimbusds.oauth2.sdk.token.BearerAccessToken buildJWTToken(AccessTokenClaimsSet claims, PrivateKey key, String alg) throws com.nimbusds.jose.JOSEException
- Throws:
com.nimbusds.jose.JOSEException
-
getSigner
private com.nimbusds.jose.JWSSigner getSigner(PrivateKey key, com.nimbusds.jose.Algorithm jwsAlgorithm) throws com.nimbusds.jose.JOSEException
Returns correct implementation of signer based on algorithm type.- Parameters:
key- signing keyjwsAlgorithm- JWS algorithm- Returns:
- signer for algorithm and private key
- Throws:
com.nimbusds.jose.JOSEException- if algorithm cannot be supported
-
-