[java-idp-oidc] branch main updated: Improve PAR tests for unsigned request objects.
Codeberg
noreply at shibboleth.net
Mon Nov 9 08:15:58 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository java-idp-oidc.
View the commit online:
https://codeberg.org/Shibboleth/java-idp-oidc/commit/436481e2c7f8b0309eb5169de4d12910c857eb2a
The following commit(s) were added to refs/heads/main by this push:
new 436481e2 Improve PAR tests for unsigned request objects.
436481e2 is described below
commit 436481e2c7f8b0309eb5169de4d12910c857eb2a
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Mon Nov 9 10:15:32 2026 +0200
Improve PAR tests for unsigned request objects.
---
.../op/profile/flow/PushedAuthorizeFlowTest.java | 60 ++++++++++++++++++++++
1 file changed, 60 insertions(+)
diff --git a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/PushedAuthorizeFlowTest.java b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/PushedAuthorizeFlowTest.java
index bb4b50bc..d54fd8f7 100644
--- a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/PushedAuthorizeFlowTest.java
+++ b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/PushedAuthorizeFlowTest.java
@@ -15,6 +15,7 @@
package net.shibboleth.idp.plugin.oidc.op.profile.flow;
import java.io.IOException;
+import java.net.URI;
import java.net.URISyntaxException;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
@@ -23,6 +24,7 @@ import java.time.Instant;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.opensaml.storage.RevocationCache;
import org.opensaml.storage.StorageService;
@@ -37,8 +39,11 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.nimbusds.jose.EncryptionMethod;
import com.nimbusds.jose.JOSEException;
+import com.nimbusds.jose.JWEAlgorithm;
import com.nimbusds.jose.JWSAlgorithm;
+import com.nimbusds.jwt.EncryptedJWT;
import com.nimbusds.jwt.JWT;
import com.nimbusds.jwt.JWTClaimsSet;
import com.nimbusds.jwt.PlainJWT;
@@ -50,6 +55,7 @@ import com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod;
import com.nimbusds.openid.connect.sdk.Nonce;
import com.nimbusds.openid.connect.sdk.OIDCClaimsRequest;
import com.nimbusds.openid.connect.sdk.claims.ClaimRequirement;
+import com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata;
import net.shibboleth.idp.plugin.oidc.op.profile.flow.support.TestRequestUriClaimsSetDecorator;
import net.shibboleth.idp.plugin.oidc.op.profile.logic.DefaultPushedAuthorizationRequestUriDeserializationFunction;
@@ -657,9 +663,63 @@ public class PushedAuthorizeFlowTest extends AbstractOidcClientAuthenticationFlo
.claim("scope", "openid profile")
.build();
final PlainJWT requestObject = new PlainJWT(ro);
+ setHttpFormRequest("POST", createRequestParameters(clientId, "openid profile", null,
+ requestObject.serialize()));
+ final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
+ assertErrorCode(result, OAuth2Error.INVALID_REQUEST_CODE);
+ }
+
+ @Test
+ public void testOAuth2EncryptedUnsignedRO() throws IOException, NoSuchAlgorithmException, URISyntaxException,
+ DataSealerException, ComponentInitializationException, JOSEException, ParseException {
+ final OIDCClientMetadata metadata = buildMetadataSkeleton();
+ metadata.setRedirectionURIs(Set.of(URI.create("https://example.org/cb")));
+ metadata.setScope(scope);
+ metadata.setRequestObjectJWSAlg(new JWSAlgorithm("none"));
+ storeMetadataObject(storageService, clientId, clientSecret, metadata);
+
+ setBasicAuth(clientId, clientSecret);
+ final JWTClaimsSet ro = new JWTClaimsSet.Builder()
+ .claim("iss", clientId)
+ .claim("client_id", clientId)
+ .claim("aud", issuer)
+ .claim("redirect_uri", "https://example.org/cb")
+ .claim("response_type", "code")
+ .claim("scope", "profile")
+ .build();
+ final EncryptedJWT requestObject = createEncryptedJWT(new PlainJWT(ro).serialize(), JWEAlgorithm.RSA_OAEP_256,
+ EncryptionMethod.A128CBC_HS256);
setHttpFormRequest("POST", createRequestParameters(clientId, "profile", null, requestObject.serialize()));
final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
assertErrorCode(result, OAuth2Error.INVALID_REQUEST_CODE);
+ assertErrorDescriptionContains(result, "InvalidRequestObject");
+ }
+
+ @Test
+ public void testOIDCEncryptedUnsignedRO() throws IOException, NoSuchAlgorithmException, URISyntaxException,
+ DataSealerException, ComponentInitializationException, JOSEException, ParseException {
+ final OIDCClientMetadata metadata = buildMetadataSkeleton();
+ metadata.setRedirectionURIs(Set.of(URI.create("https://example.org/cb")));
+ metadata.setScope(scope);
+ metadata.setRequestObjectJWSAlg(new JWSAlgorithm("none"));
+ storeMetadataObject(storageService, clientId, clientSecret, metadata);
+
+ setBasicAuth(clientId, clientSecret);
+ final JWTClaimsSet ro = new JWTClaimsSet.Builder()
+ .claim("iss", clientId)
+ .claim("client_id", clientId)
+ .claim("aud", issuer)
+ .claim("redirect_uri", "https://example.org/cb")
+ .claim("response_type", "code")
+ .claim("scope", "openid profile")
+ .build();
+ final EncryptedJWT requestObject = createEncryptedJWT(new PlainJWT(ro).serialize(), JWEAlgorithm.RSA_OAEP_256,
+ EncryptionMethod.A128CBC_HS256);
+ setHttpFormRequest("POST", createRequestParameters(clientId, "openid profile", null,
+ requestObject.serialize()));
+ final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
+ assertErrorCode(result, OAuth2Error.INVALID_REQUEST_CODE);
+ assertErrorDescriptionContains(result, "InvalidRequestObject");
}
@Test
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list