Class AbstractOidcFlowTest
- java.lang.Object
-
- org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
- net.shibboleth.idp.test.flows.AbstractFlowTest
-
- net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcFlowTest
-
- All Implemented Interfaces:
Aware,ApplicationContextAware,IHookable,ITestNGListener
- Direct Known Subclasses:
AbstractOidcApiFlowTest,AuthorizeFlowTest,ConfigurationFlowTest,IssueRegistrationAccessTokenFlowTest,KeySetFlowTest,RegistrationFlowTest,RegistrationManagementFlowTest
@ContextConfiguration(locations="classpath*:/META-INF/net.shibboleth.idp/postconfig.xml") public abstract class AbstractOidcFlowTest extends net.shibboleth.idp.test.flows.AbstractFlowTest
Abstract unit test for the OIDC flows.
-
-
Field Summary
Fields Modifier and Type Field Description private DataSealerdataSealerstatic StringEND_STATE_IDprivate StringendStateIdprivate StringflowId-
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 protectedAbstractOidcFlowTest(String id)protectedAbstractOidcFlowTest(String id, String endId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertErrorCode(FlowExecutionResult result, String errorCode)protected voidassertErrorDescriptionContains(FlowExecutionResult result, String errorDescription)protected StringbuildJsonForLegacyToken(String subject, String clientId, com.nimbusds.oauth2.sdk.Scope scope, String type, String... consentedClaims)protected static com.nimbusds.jwt.SignedJWTcreatePrivateKeyJWT(com.nimbusds.jwt.JWTClaimsSet claimsSet, RSAPrivateKey rsaPrivateKey)protected static com.nimbusds.jwt.SignedJWTcreateSecretJWT(com.nimbusds.jwt.JWTClaimsSet claimsSet, String clientSecret)protected DataSealergetDataSealer()voidinitializeMocks()Initialize mock request, response, and external context.voidinitializeThreadLocals()protected com.nimbusds.oauth2.sdk.ErrorResponseparseErrorResponse(FlowExecutionResult result)protected com.nimbusds.oauth2.sdk.ResponseparseResponse(FlowExecutionResult result)protected <AResponseType extends com.nimbusds.oauth2.sdk.Response>
AResponseTypeparseSuccessResponse(FlowExecutionResult result, Class<AResponseType> clazz)protected voidremoveMetadata(StorageService storageService, String clientId)protected voidsetBasicAuth(String username, String password)protected voidsetHttpFormRequest(String method, Map<String,String> parameters)protected voidsetJsonRequest(String method, String body)protected voidsetRequest(String method, String body, String contentType)protected voidstoreConsent(StorageService storageService, String uid, String clientId, String... ids)protected voidstoreMetadata(StorageService storageService, String clientId, String secret, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.jose.JWSAlgorithm tokenEndpointSigAlg, com.nimbusds.jose.JWEAlgorithm tokenEncAlg, com.nimbusds.jose.EncryptionMethod encMethod, com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod tokenEndpointMethod, com.nimbusds.jose.JWSAlgorithm userInfoSigAlg, RSAPublicKey publicKey, String... redirectUri)protected voidstoreMetadata(StorageService storageService, String clientId, String secret, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.jose.JWSAlgorithm tokenEndpointSigAlg, com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod tokenEndpointMethod, com.nimbusds.jose.JWSAlgorithm userInfoSigAlg, String... redirectUri)protected voidstoreMetadata(StorageService storageService, String clientId, String secret, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.jose.JWSAlgorithm tokenEndpointSigAlg, com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod tokenEndpointMethod, com.nimbusds.jose.JWSAlgorithm userInfoSigAlg, RSAPublicKey publicKey, String... redirectUri)protected voidstoreMetadata(StorageService storageService, String clientId, String secret, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.jose.JWSAlgorithm tokenEndpointSigAlg, com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod tokenEndpointMethod, String... redirectUri)protected voidstoreMetadata(StorageService storageService, String clientId, String secret, com.nimbusds.oauth2.sdk.Scope scope, String... redirectUri)-
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
-
END_STATE_ID
public static final String END_STATE_ID
- See Also:
- Constant Field Values
-
flowId
private String flowId
-
endStateId
private String endStateId
-
dataSealer
@Autowired @Qualifier("shibboleth.oidc.TokenSealer") private DataSealer dataSealer
-
-
Method Detail
-
initializeMocks
@BeforeMethod public void initializeMocks()
Initialize mock request, response, and external context. Overrides to remove authorization header.- Overrides:
initializeMocksin classnet.shibboleth.idp.test.flows.AbstractFlowTest
-
initializeThreadLocals
@BeforeMethod public void initializeThreadLocals()
- Overrides:
initializeThreadLocalsin classnet.shibboleth.idp.test.flows.AbstractFlowTest
-
getDataSealer
protected DataSealer getDataSealer()
-
parseResponse
protected com.nimbusds.oauth2.sdk.Response parseResponse(FlowExecutionResult result)
-
parseErrorResponse
protected com.nimbusds.oauth2.sdk.ErrorResponse parseErrorResponse(FlowExecutionResult result)
-
parseSuccessResponse
protected <AResponseType extends com.nimbusds.oauth2.sdk.Response> AResponseType parseSuccessResponse(FlowExecutionResult result, Class<AResponseType> clazz)
-
assertErrorCode
protected void assertErrorCode(FlowExecutionResult result, String errorCode)
-
assertErrorDescriptionContains
protected void assertErrorDescriptionContains(FlowExecutionResult result, String errorDescription)
-
setHttpFormRequest
protected void setHttpFormRequest(String method, Map<String,String> parameters)
-
storeMetadata
protected void storeMetadata(StorageService storageService, String clientId, String secret, com.nimbusds.oauth2.sdk.Scope scope, String... redirectUri) throws IOException
- Throws:
IOException
-
storeMetadata
protected void storeMetadata(StorageService storageService, String clientId, String secret, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.jose.JWSAlgorithm tokenEndpointSigAlg, com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod tokenEndpointMethod, String... redirectUri) throws IOException
- Throws:
IOException
-
storeMetadata
protected void storeMetadata(StorageService storageService, String clientId, String secret, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.jose.JWSAlgorithm tokenEndpointSigAlg, com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod tokenEndpointMethod, com.nimbusds.jose.JWSAlgorithm userInfoSigAlg, String... redirectUri) throws IOException
- Throws:
IOException
-
storeMetadata
protected void storeMetadata(StorageService storageService, String clientId, String secret, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.jose.JWSAlgorithm tokenEndpointSigAlg, com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod tokenEndpointMethod, com.nimbusds.jose.JWSAlgorithm userInfoSigAlg, RSAPublicKey publicKey, String... redirectUri) throws IOException
- Throws:
IOException
-
storeMetadata
protected void storeMetadata(StorageService storageService, String clientId, String secret, com.nimbusds.oauth2.sdk.Scope scope, com.nimbusds.jose.JWSAlgorithm tokenEndpointSigAlg, com.nimbusds.jose.JWEAlgorithm tokenEncAlg, com.nimbusds.jose.EncryptionMethod encMethod, com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod tokenEndpointMethod, com.nimbusds.jose.JWSAlgorithm userInfoSigAlg, RSAPublicKey publicKey, String... redirectUri) throws IOException
- Throws:
IOException
-
removeMetadata
protected void removeMetadata(StorageService storageService, String clientId) throws IOException
- Throws:
IOException
-
storeConsent
protected void storeConsent(StorageService storageService, String uid, String clientId, String... ids) throws IOException
- Throws:
IOException
-
buildJsonForLegacyToken
protected String buildJsonForLegacyToken(String subject, String clientId, com.nimbusds.oauth2.sdk.Scope scope, String type, String... consentedClaims)
-
createSecretJWT
protected static com.nimbusds.jwt.SignedJWT createSecretJWT(com.nimbusds.jwt.JWTClaimsSet claimsSet, String clientSecret) throws com.nimbusds.jose.JOSEException- Throws:
com.nimbusds.jose.JOSEException
-
createPrivateKeyJWT
protected static com.nimbusds.jwt.SignedJWT createPrivateKeyJWT(com.nimbusds.jwt.JWTClaimsSet claimsSet, RSAPrivateKey rsaPrivateKey) throws com.nimbusds.jose.JOSEException- Throws:
com.nimbusds.jose.JOSEException
-
-