diff --git a/cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/uaa/clients/ReactorClientsTest.java b/cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/uaa/clients/ReactorClientsTest.java index a9d730008a..ce8d31b5a2 100644 --- a/cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/uaa/clients/ReactorClientsTest.java +++ b/cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/uaa/clients/ReactorClientsTest.java @@ -133,6 +133,7 @@ void batchChangeSecret() { .resourceId("none") .scopes("clients.read", "clients.write") .tokenSalt("uHICvG") + .allowPublic(true) .build()) .client( Client.builder() @@ -155,6 +156,7 @@ void batchChangeSecret() { .resourceId("none") .scopes("clients.read", "clients.write") .tokenSalt("WjlWvu") + .allowPublic(true) .build()) .build()) .expectComplete() @@ -279,6 +281,7 @@ void batchDelete() { .client( Client.builder() .approvalsDeleted(true) + .allowPublic(true) .allowedProviders("uaa", "ldap", "my-saml-provider") .authorities("clients.read", "clients.write") .authorizedGrantType(CLIENT_CREDENTIALS) @@ -296,6 +299,7 @@ void batchDelete() { .client( Client.builder() .approvalsDeleted(true) + .allowPublic(true) .allowedProviders("uaa", "ldap", "my-saml-provider") .authorities("clients.read", "clients.write") .authorizedGrantType(CLIENT_CREDENTIALS) @@ -469,6 +473,7 @@ void create() { .authorities("clients.read", "clients.write") .authorizedGrantType(CLIENT_CREDENTIALS) .autoApprove("true") + .allowPublic(true) .clientId("aPq3I1") .clientSecret("secret") .name("My Client Name") @@ -494,6 +499,7 @@ void create() { .resourceId("none") .scopes("clients.read", "clients.write") .tokenSalt("hRZ21X") + .allowPublic(true) .build()) .expectComplete() .verify(Duration.ofSeconds(5)); @@ -819,6 +825,7 @@ void mixedActions() { .refreshTokenValidity(7000L) .scopes("clients.read", "clients.write") .tokenSalt("UpzrHR") + .allowPublic(true) .build()) .build()) .as(StepVerifier::create) @@ -852,6 +859,7 @@ void mixedActions() { .resourceId("none") .scopes("clients.read", "clients.write") .tokenSalt("WjlWvu") + .allowPublic(true) .build()) .client( ActionClient.builder() @@ -871,6 +879,7 @@ void mixedActions() { .resourceId("none") .scopes("clients.read", "clients.write") .tokenSalt("UpzrHR") + .allowPublic(true) .build()) .build()) .expectComplete() @@ -901,6 +910,7 @@ void update() { .autoApprove("clients.autoapprove") .clientId("55pTMX") .scopes("clients.new", "clients.autoapprove") + .allowPublic(true) .build()) .as(StepVerifier::create) .expectNext( @@ -918,6 +928,7 @@ void update() { .resourceId("none") .scopes("clients.new", "clients.autoapprove") .tokenSalt("8mwCEy") + .allowPublic(true) .build()) .expectComplete() .verify(Duration.ofSeconds(5)); diff --git a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_request.json b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_request.json index cd24223fe7..ff9cb074b9 100644 --- a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_request.json +++ b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_request.json @@ -25,5 +25,6 @@ "clients.read", "clients.write" ], - "token_salt": "hRZ21X" + "token_salt": "hRZ21X", + "allowpublic": true } \ No newline at end of file diff --git a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_response.json b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_response.json index bc91157c3b..d61bedfc92 100644 --- a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_response.json +++ b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_response.json @@ -28,5 +28,6 @@ "my-saml-provider" ], "name": "My Client Name", + "allowpublic": true, "lastModified": 1468364445109 } \ No newline at end of file diff --git a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_delete_response.json b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_delete_response.json index 4b113ed45a..84fa404dd1 100644 --- a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_delete_response.json +++ b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_delete_response.json @@ -30,7 +30,8 @@ ], "name": "My Client Name", "lastModified": 1468364444461, - "approvals_deleted": true + "approvals_deleted": true, + "allowpublic": true }, { "scope": [ @@ -63,6 +64,7 @@ ], "name": "My Client Name", "lastModified": 1468364444868, - "approvals_deleted": true + "approvals_deleted": true, + "allowpublic": true } ] \ No newline at end of file diff --git a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_modify_request.json b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_modify_request.json index c25d438d83..976b638b7f 100644 --- a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_modify_request.json +++ b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_modify_request.json @@ -39,6 +39,7 @@ "redirect_uri": [ "http://test1.com", "http*://ant.path.wildcard/**/passback/*" - ] + ], + "allowpublic": true } ] diff --git a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_modify_response.json b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_modify_response.json index a0bed0ad73..a3fe946d72 100644 --- a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_modify_response.json +++ b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_modify_response.json @@ -43,7 +43,8 @@ ], "name": "My Client Name", "lastModified": 1474923482302, - "approvals_deleted": true + "approvals_deleted": true, + "allowpublic": true }, { "scope": [ @@ -78,6 +79,7 @@ "my-saml-provider" ], "name": "My Client Name", + "allowpublic": true, "lastModified": 1474923482727 } ] \ No newline at end of file diff --git a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_secret_response.json b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_secret_response.json index dcfd19a32a..66cdbf957a 100644 --- a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_secret_response.json +++ b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/POST_tx_secret_response.json @@ -32,7 +32,8 @@ ], "name": "My Client Name", "lastModified": 1474923482301, - "approvals_deleted": true + "approvals_deleted": true, + "allowpublic": true }, { "scope": [ @@ -68,6 +69,7 @@ ], "name": "My Client Name", "lastModified": 1474923482302, - "approvals_deleted": true + "approvals_deleted": true, + "allowpublic": true } ] \ No newline at end of file diff --git a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/PUT_{id}_request.json b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/PUT_{id}_request.json index d3f59d11cc..6d48b51404 100644 --- a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/PUT_{id}_request.json +++ b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/PUT_{id}_request.json @@ -9,5 +9,6 @@ ], "autoapprove": [ "clients.autoapprove" - ] + ], + "allowpublic": true } diff --git a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/PUT_{id}_response.json b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/PUT_{id}_response.json index 64704ce173..3f5e88a93f 100644 --- a/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/PUT_{id}_response.json +++ b/cloudfoundry-client-reactor/src/test/resources/fixtures/uaa/clients/PUT_{id}_response.json @@ -28,5 +28,6 @@ "my-saml-provider" ], "name": "My Client Name", + "allowpublic": true, "lastModified": 1468364443857 } diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractClient.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractClient.java index a761952b0c..6fa73e06c0 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractClient.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractClient.java @@ -54,6 +54,13 @@ abstract class AbstractClient { @Nullable abstract Boolean getApprovalsDeleted(); + /** + * If true, allow to omit client_secret for authorization_code flow in combination with PKCE + */ + @JsonProperty("allowpublic") + @Nullable + abstract Boolean getAllowPublic(); + /** * Scopes that the client is able to grant when creating a client */ diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractCreateClient.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractCreateClient.java index f5d10479c1..92e4a952bd 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractCreateClient.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractCreateClient.java @@ -57,6 +57,13 @@ void checkAuthorizedGrantTypes() { @Nullable abstract Boolean getApprovalsDeleted(); + /** + * If client allows authentication_code flow with PKCE w/o client_secret + */ + @JsonProperty("allowpublic") + @Nullable + abstract Boolean getAllowPublic(); + /** * Scopes that the client is able to grant when creating a client */ diff --git a/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractUpdateClient.java b/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractUpdateClient.java index de8b2ff317..bf3466f32e 100644 --- a/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractUpdateClient.java +++ b/cloudfoundry-client/src/main/java/org/cloudfoundry/uaa/clients/AbstractUpdateClient.java @@ -50,6 +50,13 @@ void checkAuthorizedGrantType() { @Nullable abstract Boolean getApprovalsDeleted(); + /** + * If client allows authentication_code flow with PKCE w/o client_secret + */ + @JsonProperty("allowpublic") + @Nullable + abstract Boolean getAllowPublic(); + /** * Scopes that the client is able to grant when creating a client */