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,IHookable,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
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 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.BearerAccessTokenbuildToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope)protected com.nimbusds.oauth2.sdk.token.BearerAccessTokenbuildToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.openid.connect.sdk.claims.ClaimsSet userInfoDeliverySet)protected com.nimbusds.oauth2.sdk.token.BearerAccessTokenbuildToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.openid.connect.sdk.claims.ClaimsSet userInfoDeliverySet, String id, String rootId)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, 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
-
-
-
-
Constructor Detail
-
AbstractOidcApiFlowTest
protected AbstractOidcApiFlowTest(String flowId)
-
-
Method Detail
-
buildToken
protected com.nimbusds.oauth2.sdk.token.BearerAccessToken buildToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope) throws URISyntaxException, NoSuchAlgorithmException, DataSealerException, ComponentInitializationException
-
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
-
buildToken
protected com.nimbusds.oauth2.sdk.token.BearerAccessToken buildToken(String clientId, String subject, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.openid.connect.sdk.claims.ClaimsSet userInfoDeliverySet) throws URISyntaxException, NoSuchAlgorithmException, DataSealerException, ComponentInitializationException
-
buildToken
protected com.nimbusds.oauth2.sdk.token.BearerAccessToken buildToken(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) 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
-
-