Class AuthorizeFlowTest

    • Constructor Detail

      • AuthorizeFlowTest

        public AuthorizeFlowTest()
    • Method Detail

      • setup

        @BeforeMethod
        public void setup()
      • testWithAuthorizationCodeFlow

        public void testWithAuthorizationCodeFlow()
                                           throws IOException,
                                                  net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowRequestObjectEnforcedNoRO

        public void testWithAuthorizationCodeFlowRequestObjectEnforcedNoRO()
                                                                    throws IOException,
                                                                           net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowAndResource

        public void testWithAuthorizationCodeFlowAndResource()
                                                      throws IOException,
                                                             net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowIssInResponse

        public void testWithAuthorizationCodeFlowIssInResponse()
                                                        throws IOException,
                                                               net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowNoOpenidMetadataContainsResource

        public void testWithAuthorizationCodeFlowNoOpenidMetadataContainsResource()
                                                                           throws IOException,
                                                                                  net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowNoOpenidMetadataNotContainingResource

        public void testWithAuthorizationCodeFlowNoOpenidMetadataNotContainingResource()
                                                                                throws IOException,
                                                                                       net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowNoRedirectURI

        public void testWithAuthorizationCodeFlowNoRedirectURI()
                                                        throws IOException,
                                                               net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithImplicitFlowNoNonce

        public void testWithImplicitFlowNoNonce()
                                         throws IOException,
                                                net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithImplicitFlow

        public void testWithImplicitFlow()
                                  throws IOException,
                                         net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithImplicitFlowRequestObjectEnforcedNoRO

        public void testWithImplicitFlowRequestObjectEnforcedNoRO()
                                                           throws IOException,
                                                                  net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithImplicitFlowAndResource

        public void testWithImplicitFlowAndResource()
                                             throws IOException,
                                                    net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithImplicitTokenFlowRequestObjectEnforcedNoRO

        public void testWithImplicitTokenFlowRequestObjectEnforcedNoRO()
                                                                throws IOException,
                                                                       net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithImplicitTokenFlowAndResource

        public void testWithImplicitTokenFlowAndResource()
                                                  throws IOException,
                                                         net.shibboleth.idp.session.SessionException,
                                                         ParseException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
        ParseException
      • testWithImplicitTokenFlowNoNonce

        public void testWithImplicitTokenFlowNoNonce()
                                              throws IOException,
                                                     net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithImplicitOidcFlowNoOpenIdScopeRequested

        public void testWithImplicitOidcFlowNoOpenIdScopeRequested()
                                                            throws IOException,
                                                                   net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithImplicitOidcFlowNoOpenIdScopeRegistered

        public void testWithImplicitOidcFlowNoOpenIdScopeRegistered()
                                                             throws IOException,
                                                                    net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithImplicitFlowNoRedirectURI

        public void testWithImplicitFlowNoRedirectURI()
                                               throws IOException,
                                                      net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithHybridIdTokenFlowRequestObjectEnforcedNoRO

        public void testWithHybridIdTokenFlowRequestObjectEnforcedNoRO()
                                                                throws IOException,
                                                                       net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithHybridIdTokenFlowIssInResponse

        public void testWithHybridIdTokenFlowIssInResponse()
                                                    throws IOException,
                                                           net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithHybridIdTokenFlowAndResource

        public void testWithHybridIdTokenFlowAndResource()
                                                  throws IOException,
                                                         net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithHybridIdTokenFlowNoNonce

        public void testWithHybridIdTokenFlowNoNonce()
                                              throws IOException,
                                                     net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithHybridTokenFlowRequestObjectEnforcedNoRO

        public void testWithHybridTokenFlowRequestObjectEnforcedNoRO()
                                                              throws IOException,
                                                                     net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithHybridIdTokenTokenFlowRequestObjectEnforcedNoRO

        public void testWithHybridIdTokenTokenFlowRequestObjectEnforcedNoRO()
                                                                     throws IOException,
                                                                            net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithHybridIdTokenTokenFlowAndResource

        public void testWithHybridIdTokenTokenFlowAndResource()
                                                       throws IOException,
                                                              net.shibboleth.idp.session.SessionException,
                                                              ParseException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
        ParseException
      • testWithHybridIdTokenTokenFlowNoNonce

        public void testWithHybridIdTokenTokenFlowNoNonce()
                                                   throws IOException,
                                                          net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowUnforcedPKCE

        public void testWithAuthorizationCodeFlowUnforcedPKCE()
                                                       throws IOException,
                                                              net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowForcedPlainPKCEMissingChallenge

        public void testWithAuthorizationCodeFlowForcedPlainPKCEMissingChallenge()
                                                                          throws IOException,
                                                                                 net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowForcedPlainPKCEUnknownChallenge

        public void testWithAuthorizationCodeFlowForcedPlainPKCEUnknownChallenge()
                                                                          throws IOException,
                                                                                 net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowForcedPlainPKCEValidChallenge

        public void testWithAuthorizationCodeFlowForcedPlainPKCEValidChallenge()
                                                                        throws IOException,
                                                                               net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowForcedS256PKCEPlainChallenge

        public void testWithAuthorizationCodeFlowForcedS256PKCEPlainChallenge()
                                                                       throws IOException,
                                                                              net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowForcedS256PKCEUnknownChallenge

        public void testWithAuthorizationCodeFlowForcedS256PKCEUnknownChallenge()
                                                                         throws IOException,
                                                                                net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowForcedS256PKCEValidChallenge

        public void testWithAuthorizationCodeFlowForcedS256PKCEValidChallenge()
                                                                       throws IOException,
                                                                              net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowNoScopesRegistered

        public void testWithAuthorizationCodeFlowNoScopesRegistered()
                                                             throws IOException,
                                                                    net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowNoScopesRegisteredIssInResponse

        public void testWithAuthorizationCodeFlowNoScopesRegisteredIssInResponse()
                                                                          throws IOException,
                                                                                 net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowUsingSAMLMetadata

        public void testWithAuthorizationCodeFlowUsingSAMLMetadata()
                                                            throws IOException,
                                                                   net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithAuthorizationCodeFlowUsingUntrustedRP

        public void testWithAuthorizationCodeFlowUsingUntrustedRP()
                                                           throws IOException,
                                                                  net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithPlainReqObjectExpired

        public void testWithPlainReqObjectExpired()
                                           throws IOException,
                                                  net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithPlainReqObjectNbfInFuture

        public void testWithPlainReqObjectNbfInFuture()
                                               throws IOException,
                                                      net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithPlainReqObjectOverwriteRedirectUri

        public void testWithPlainReqObjectOverwriteRedirectUri()
                                                        throws IOException,
                                                               net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithPlainReqObjectOverwriteRedirectUriROEnforced

        public void testWithPlainReqObjectOverwriteRedirectUriROEnforced()
                                                                  throws IOException,
                                                                         net.shibboleth.idp.session.SessionException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
      • testWithHS256SignedReqObjectNoIssuer

        public void testWithHS256SignedReqObjectNoIssuer()
                                                  throws IOException,
                                                         net.shibboleth.idp.session.SessionException,
                                                         com.nimbusds.jose.JOSEException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
        com.nimbusds.jose.JOSEException
      • testWithHS256SignedReqObjectNoAudience

        public void testWithHS256SignedReqObjectNoAudience()
                                                    throws IOException,
                                                           net.shibboleth.idp.session.SessionException,
                                                           com.nimbusds.jose.JOSEException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
        com.nimbusds.jose.JOSEException
      • testWithHS256SignedReqObjectWrongIssuer

        public void testWithHS256SignedReqObjectWrongIssuer()
                                                     throws IOException,
                                                            net.shibboleth.idp.session.SessionException,
                                                            com.nimbusds.jose.JOSEException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
        com.nimbusds.jose.JOSEException
      • testWithHS256SignedReqObjectWrongAudience

        public void testWithHS256SignedReqObjectWrongAudience()
                                                       throws IOException,
                                                              net.shibboleth.idp.session.SessionException,
                                                              com.nimbusds.jose.JOSEException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
        com.nimbusds.jose.JOSEException
      • testWithHS256SignedReqObjectWrongSecret

        public void testWithHS256SignedReqObjectWrongSecret()
                                                     throws IOException,
                                                            net.shibboleth.idp.session.SessionException,
                                                            com.nimbusds.jose.JOSEException
        Throws:
        IOException
        net.shibboleth.idp.session.SessionException
        com.nimbusds.jose.JOSEException
      • testWithHS256SignedReqObjectOverwriteRedirectUri

        public void testWithHS256SignedReqObjectOverwriteRedirectUri()
                                                              throws IOException,
                                                                     ParseException,
                                                                     net.shibboleth.idp.session.SessionException,
                                                                     com.nimbusds.jose.JOSEException
        Throws:
        IOException
        ParseException
        net.shibboleth.idp.session.SessionException
        com.nimbusds.jose.JOSEException
      • createIdTokenSecurityTests

        @Factory
        public Object[] createIdTokenSecurityTests()
      • createAccessTokenSecurityTests

        @Factory
        public Object[] createAccessTokenSecurityTests()
      • createRequestObjectSecurityTests

        @Factory
        public Object[] createRequestObjectSecurityTests()
      • getRequestObjectWithClaimsRequestPayload

        protected static String getRequestObjectWithClaimsRequestPayload​(String clientId,
                                                                         String redirectUri)
      • assertRequestObjectError

        protected void assertRequestObjectError​(com.nimbusds.jwt.JWT requestObject)
                                         throws IOException
        Throws:
        IOException
      • assertRequestObjectError

        protected void assertRequestObjectError​(com.nimbusds.jwt.JWT requestObject,
                                                com.nimbusds.jose.JWSAlgorithm requestObjectSigAlg)
                                         throws IOException
        Throws:
        IOException
      • assertRequestObjectError

        protected void assertRequestObjectError​(com.nimbusds.jwt.JWT requestObject,
                                                com.nimbusds.jose.JWSAlgorithm requestObjectSigAlg,
                                                PublicKey publicKey)
                                         throws IOException
        Throws:
        IOException
      • assertRequestObjectError

        protected void assertRequestObjectError​(String requestObject,
                                                com.nimbusds.jose.JWSAlgorithm requestObjectSigAlg,
                                                PublicKey publicKey,
                                                com.nimbusds.jose.JWEAlgorithm requestObjectEncAlg,
                                                com.nimbusds.jose.EncryptionMethod requestObjectEncMethod)
                                         throws IOException
        Throws:
        IOException
      • assertErrorResponseWithNoIssuer

        protected void assertErrorResponseWithNoIssuer​(FlowExecutionResult result)
      • assertErrorResponseWithIssuer

        protected void assertErrorResponseWithIssuer​(FlowExecutionResult result)
      • getSidFromAuthorizeCodeClaimsSet

        protected String getSidFromAuthorizeCodeClaimsSet​(com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponse successResponse)
      • getSidFromOpaqueAccessTokenClaimsSet

        protected String getSidFromOpaqueAccessTokenClaimsSet​(com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponse successResponse)
      • getSidFromJWTAccessTokenClaimsSet

        protected String getSidFromJWTAccessTokenClaimsSet​(com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponse successResponse)
      • getSidFromIDToken

        protected String getSidFromIDToken​(com.nimbusds.openid.connect.sdk.AuthenticationSuccessResponse successResponse)
      • setRequestParameters

        protected void setRequestParameters​(List<Pair<String,​String>> pairs)