[java-idp-oidc] 04/04: JOIDC-73 - Support for requests by reference is unconstrained
Henri Mikkonen
henri.mikkonen at iki.fi
Mon Jan 31 12:38:06 UTC 2022
This is an automated email from the git hooks/post-receive script.
hjmikkon pushed a commit to branch maint-3.0
in repository java-idp-oidc.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-oidc.git;a=commit;h=7c99a6588871a573c12467336ef8f3e92d2b7075
commit 7c99a6588871a573c12467336ef8f3e92d2b7075
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Mon Jan 31 14:35:22 2022 +0200
JOIDC-73 - Support for requests by reference is unconstrained
https://shibboleth.atlassian.net/browse/JOIDC-73
Verify in the registration flow test that the possible use of request_uris
-claim in the request is ignored (i.e. not stored nor included in the response).
---
.../oidc/op/profile/flow/RegistrationFlowTest.java | 28 ++++++++++++++++------
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/RegistrationFlowTest.java b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/RegistrationFlowTest.java
index d25d10d4..6895ef28 100644
--- a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/RegistrationFlowTest.java
+++ b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/flow/RegistrationFlowTest.java
@@ -71,18 +71,32 @@ public class RegistrationFlowTest extends AbstractOidcFlowTest {
public void testSuccess() throws ParseException, IOException, net.minidev.json.parser.ParseException {
setJsonRequest("POST", "{ \"redirect_uris\":[\"" + redirectUri + "\"] }");
final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
- OIDCClientInformationResponse parsedResponse = parseSuccessResponse(result, OIDCClientInformationResponse.class);
- OIDCClientInformation clientInfo = parsedResponse.getOIDCClientInformation();
- OIDCClientMetadata metadata = clientInfo.getOIDCMetadata();
- String record = storageService.read(BaseStorageServiceClientInformationComponent.CONTEXT_NAME,
+ assertSuccessResponse(parseSuccessResponse(result, OIDCClientInformationResponse.class));
+ }
+
+ @Test
+ public void testSuccessWithRequestUri() throws ParseException, IOException, net.minidev.json.parser.ParseException {
+ setJsonRequest("POST", "{ \"redirect_uris\":[\"" + redirectUri + "\"], \"request_uris\":[\"https://example.org/request\"] }");
+ final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
+ assertSuccessResponse(parseSuccessResponse(result, OIDCClientInformationResponse.class));
+ }
+
+ protected void assertSuccessResponse(final OIDCClientInformationResponse parsedResponse)
+ throws IOException, ParseException, net.minidev.json.parser.ParseException {
+ final OIDCClientInformation clientInfo = parsedResponse.getOIDCClientInformation();
+ final OIDCClientMetadata metadata = clientInfo.getOIDCMetadata();
+ final String record = storageService.read(BaseStorageServiceClientInformationComponent.CONTEXT_NAME,
clientInfo.getID().toString()).getValue();
Assert.assertNotNull(record);
- JSONParser parser = new JSONParser(JSONParser.DEFAULT_PERMISSIVE_MODE);
- OIDCClientInformation storedInfo = OIDCClientInformation.parse((JSONObject) parser.parse(record));
+ final JSONParser parser = new JSONParser(JSONParser.DEFAULT_PERMISSIVE_MODE);
+ final OIDCClientInformation storedInfo = OIDCClientInformation.parse((JSONObject) parser.parse(record));
Assert.assertEquals(storedInfo.getID(), clientInfo.getID());
Assert.assertEquals(storedInfo.getSecret(), clientInfo.getSecret());
- Assert.assertEquals(storedInfo.getOIDCMetadata().getRedirectionURIStrings(), metadata.getRedirectionURIStrings());
+ final OIDCClientMetadata storedMetadata = storedInfo.getOIDCMetadata();
+ Assert.assertEquals(storedMetadata.getRedirectionURIStrings(), metadata.getRedirectionURIStrings());
Assert.assertTrue(metadata.getRedirectionURIStrings().contains(redirectUri));
+ Assert.assertEquals(storedMetadata.getRequestObjectURIs(), metadata.getRequestObjectURIs());
+ Assert.assertNull(storedMetadata.getRequestObjectURIs());
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list