Class AbstractOidcFlowTest

    • Constructor Detail

      • AbstractOidcFlowTest

        protected AbstractOidcFlowTest​(String id)
      • AbstractOidcFlowTest

        protected AbstractOidcFlowTest​(String id,
                                       String endId)
    • Method Detail

      • initializeMocks

        @BeforeMethod
        public void initializeMocks()
        Initialize mock request, response, and external context. Overrides to remove authorization header.
        Overrides:
        initializeMocks in class net.shibboleth.idp.test.flows.AbstractFlowTest
      • initializeECKey

        protected com.nimbusds.jose.jwk.ECKey initializeECKey​(com.nimbusds.jose.jwk.Curve curve,
                                                              String kid)
      • 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)
      • assertErrorDescriptionContains

        protected void assertErrorDescriptionContains​(FlowExecutionResult result,
                                                      String errorDescription)
      • setJsonRequest

        protected void setJsonRequest​(String method,
                                      String body)
      • setHttpFormRequest

        protected void setHttpFormRequest​(String method,
                                          Map<String,​String> parameters)
      • setBasicAuth

        protected void setBasicAuth​(String username,
                                    String password)
      • setRequest

        protected void setRequest​(String method,
                                  String body,
                                  String contentType)
      • storeMetadata

        protected void storeMetadata​(StorageService storageService,
                                     String clientId,
                                     String secret,
                                     com.nimbusds.oauth2.sdk.Scope scope,
                                     com.nimbusds.jose.JWSAlgorithm requestObjectSigAlg,
                                     PublicKey publicKey,
                                     com.nimbusds.jose.JWEAlgorithm requestObjectEncAlg,
                                     com.nimbusds.jose.EncryptionMethod requestObjectEncMethod,
                                     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,
                                     PublicKey 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,
                                     PublicKey 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,
                                     PublicKey publicKey,
                                     boolean addResources,
                                     com.nimbusds.jose.JWSAlgorithm requestObjectSigAlg,
                                     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,
                                     PublicKey publicKey,
                                     boolean addResources,
                                     com.nimbusds.jose.JWSAlgorithm requestObjectSigAlg,
                                     com.nimbusds.jose.JWEAlgorithm requestObjectEncAlg,
                                     com.nimbusds.jose.EncryptionMethod requestObjectEncMethod,
                                     String... redirectUri)
                              throws IOException
        Throws:
        IOException
      • buildMetadataSkeleton

        protected static com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata buildMetadataSkeleton()
      • buildJWKSet

        protected static com.nimbusds.jose.jwk.JWKSet buildJWKSet​(PublicKey... publicKeys)
      • 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
      • createSecretJWT

        protected static com.nimbusds.jwt.SignedJWT createSecretJWT​(com.nimbusds.jwt.JWTClaimsSet claimsSet,
                                                                    String clientSecret,
                                                                    com.nimbusds.jose.JWSAlgorithm algorithm)
      • 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
      • createPrivateKeyJWT

        protected static com.nimbusds.jwt.SignedJWT createPrivateKeyJWT​(com.nimbusds.jwt.JWTClaimsSet claimsSet,
                                                                        RSAPrivateKey rsaPrivateKey,
                                                                        com.nimbusds.jose.JWSAlgorithm algorithm)
                                                                 throws com.nimbusds.jose.JOSEException
        Throws:
        com.nimbusds.jose.JOSEException
      • createPrivateKeyJWT

        protected static com.nimbusds.jwt.SignedJWT createPrivateKeyJWT​(com.nimbusds.jwt.JWTClaimsSet claimsSet,
                                                                        ECPrivateKey ecPrivateKey,
                                                                        com.nimbusds.jose.JWSAlgorithm algorithm)
                                                                 throws com.nimbusds.jose.JOSEException
        Throws:
        com.nimbusds.jose.JOSEException
      • createEncryptedJWT

        protected static com.nimbusds.jwt.EncryptedJWT createEncryptedJWT​(String contents,
                                                                          com.nimbusds.jose.JWEAlgorithm algorithm,
                                                                          com.nimbusds.jose.EncryptionMethod method)
                                                                   throws com.nimbusds.jose.JOSEException,
                                                                          ParseException
        Throws:
        com.nimbusds.jose.JOSEException
        ParseException
      • createEncryptedJWT

        protected static com.nimbusds.jwt.EncryptedJWT createEncryptedJWT​(String contents,
                                                                          com.nimbusds.jose.JWEAlgorithm algorithm,
                                                                          com.nimbusds.jose.EncryptionMethod method,
                                                                          net.shibboleth.oidc.security.credential.BasicJWKCredential credential,
                                                                          String clientSecret)
                                                                   throws com.nimbusds.jose.JOSEException,
                                                                          ParseException
        Throws:
        com.nimbusds.jose.JOSEException
        ParseException
      • createEncryptedJWT

        protected static com.nimbusds.jwt.EncryptedJWT createEncryptedJWT​(String contents,
                                                                          com.nimbusds.jose.JWEAlgorithm algorithm,
                                                                          com.nimbusds.jose.EncryptionMethod method,
                                                                          net.shibboleth.oidc.security.credential.BasicJWKCredential credential,
                                                                          String clientSecret,
                                                                          boolean setKid)
                                                                   throws com.nimbusds.jose.JOSEException,
                                                                          ParseException
        Throws:
        com.nimbusds.jose.JOSEException
        ParseException
      • loadEncryptionCredential

        protected static net.shibboleth.oidc.security.credential.BasicJWKCredential loadEncryptionCredential()
      • loadRSSigningCredential

        protected static net.shibboleth.oidc.security.credential.BasicJWKCredential loadRSSigningCredential()
      • loadESSigningCredential

        protected static net.shibboleth.oidc.security.credential.BasicJWKCredential loadESSigningCredential()
      • loadES384SigningCredential

        protected static net.shibboleth.oidc.security.credential.BasicJWKCredential loadES384SigningCredential()
      • loadES512SigningCredential

        protected static net.shibboleth.oidc.security.credential.BasicJWKCredential loadES512SigningCredential()
      • loadCredential

        protected static net.shibboleth.oidc.security.credential.BasicJWKCredential loadCredential​(String classPathLocation)