|
15 | 15 | public class ClientTest extends JsonTest<Client> { |
16 | 16 |
|
17 | 17 | private static final String readOnlyJson = "{\"client_id\":\"clientId\",\"is_heroku_app\":true,\"signing_keys\":[{\"cert\":\"ce\",\"pkcs7\":\"pk\",\"subject\":\"su\"}]}"; |
18 | | - private static final String json = "{\"name\":\"name\",\"description\":\"description\",\"client_secret\":\"secret\",\"app_type\":\"type\",\"logo_uri\":\"uri\",\"oidc_conformant\":true,\"is_first_party\":true,\"initiate_login_uri\":\"https://myhome.com/login\",\"callbacks\":[\"value\"],\"allowed_origins\":[\"value\"],\"web_origins\":[\"value\"],\"grant_types\":[\"value\"],\"client_aliases\":[\"value\"],\"allowed_clients\":[\"value\"],\"allowed_logout_urls\":[\"value\"],\"organization_usage\":\"allow\",\"organization_require_behavior\":\"no_prompt\",\"jwt_configuration\":{\"lifetime_in_seconds\":100,\"scopes\":\"openid\",\"alg\":\"alg\"},\"encryption_key\":{\"pub\":\"pub\",\"cert\":\"cert\"},\"sso\":true,\"sso_disabled\":true,\"custom_login_page_on\":true,\"custom_login_page\":\"custom\",\"custom_login_page_preview\":\"preview\",\"form_template\":\"template\",\"addons\":{\"rms\":{},\"mscrm\":{},\"slack\":{},\"layer\":{}},\"token_endpoint_auth_method\":\"method\",\"client_metadata\":{\"key\":\"value\"},\"mobile\":{\"android\":{\"app_package_name\":\"pkg\",\"sha256_cert_fingerprints\":[\"256\"]},\"ios\":{\"team_id\":\"team\",\"app_bundle_identifier\":\"id\"}},\"refresh_token\":{\"rotation_type\":\"non-rotating\"}}"; |
| 18 | + private static final String json = "{\n" + |
| 19 | + " \"name\": \"name\",\n" + |
| 20 | + " \"description\": \"description\",\n" + |
| 21 | + " \"client_secret\": \"secret\",\n" + |
| 22 | + " \"app_type\": \"type\",\n" + |
| 23 | + " \"logo_uri\": \"uri\",\n" + |
| 24 | + " \"oidc_conformant\": true,\n" + |
| 25 | + " \"is_first_party\": true,\n" + |
| 26 | + " \"initiate_login_uri\": \"https://myhome.com/login\",\n" + |
| 27 | + " \"callbacks\": [\n" + |
| 28 | + " \"value\"\n" + |
| 29 | + " ],\n" + |
| 30 | + " \"allowed_origins\": [\n" + |
| 31 | + " \"value\"\n" + |
| 32 | + " ],\n" + |
| 33 | + " \"web_origins\": [\n" + |
| 34 | + " \"value\"\n" + |
| 35 | + " ],\n" + |
| 36 | + " \"grant_types\": [\n" + |
| 37 | + " \"value\"\n" + |
| 38 | + " ],\n" + |
| 39 | + " \"client_aliases\": [\n" + |
| 40 | + " \"value\"\n" + |
| 41 | + " ],\n" + |
| 42 | + " \"allowed_clients\": [\n" + |
| 43 | + " \"value\"\n" + |
| 44 | + " ],\n" + |
| 45 | + " \"allowed_logout_urls\": [\n" + |
| 46 | + " \"value\"\n" + |
| 47 | + " ],\n" + |
| 48 | + " \"organization_usage\": \"allow\",\n" + |
| 49 | + " \"organization_require_behavior\": \"no_prompt\",\n" + |
| 50 | + " \"jwt_configuration\": {\n" + |
| 51 | + " \"lifetime_in_seconds\": 100,\n" + |
| 52 | + " \"scopes\": \"openid\",\n" + |
| 53 | + " \"alg\": \"alg\"\n" + |
| 54 | + " },\n" + |
| 55 | + " \"encryption_key\": {\n" + |
| 56 | + " \"pub\": \"pub\",\n" + |
| 57 | + " \"cert\": \"cert\"\n" + |
| 58 | + " },\n" + |
| 59 | + " \"sso\": true,\n" + |
| 60 | + " \"sso_disabled\": true,\n" + |
| 61 | + " \"custom_login_page_on\": true,\n" + |
| 62 | + " \"custom_login_page\": \"custom\",\n" + |
| 63 | + " \"custom_login_page_preview\": \"preview\",\n" + |
| 64 | + " \"form_template\": \"template\",\n" + |
| 65 | + " \"addons\": {\n" + |
| 66 | + " \"rms\": {},\n" + |
| 67 | + " \"mscrm\": {},\n" + |
| 68 | + " \"slack\": {},\n" + |
| 69 | + " \"layer\": {}\n" + |
| 70 | + " },\n" + |
| 71 | + " \"token_endpoint_auth_method\": \"method\",\n" + |
| 72 | + " \"client_metadata\": {\n" + |
| 73 | + " \"key\": \"value\"\n" + |
| 74 | + " },\n" + |
| 75 | + " \"mobile\": {\n" + |
| 76 | + " \"android\": {\n" + |
| 77 | + " \"app_package_name\": \"pkg\",\n" + |
| 78 | + " \"sha256_cert_fingerprints\": [\n" + |
| 79 | + " \"256\"\n" + |
| 80 | + " ]\n" + |
| 81 | + " },\n" + |
| 82 | + " \"ios\": {\n" + |
| 83 | + " \"team_id\": \"team\",\n" + |
| 84 | + " \"app_bundle_identifier\": \"id\"\n" + |
| 85 | + " }\n" + |
| 86 | + " },\n" + |
| 87 | + " \"refresh_token\": {\n" + |
| 88 | + " \"rotation_type\": \"non-rotating\"\n" + |
| 89 | + " },\n" + |
| 90 | + " \"require_pushed_authorization_requests\": true\n" + |
| 91 | + "}"; |
19 | 92 |
|
20 | 93 | @Test |
21 | 94 | public void shouldSerialize() throws Exception { |
@@ -58,6 +131,7 @@ public void shouldSerialize() throws Exception { |
58 | 131 | client.setRefreshToken(refreshToken); |
59 | 132 | client.setOrganizationUsage("require"); |
60 | 133 | client.setOrganizationRequireBehavior("pre_login_prompt"); |
| 134 | + client.setRequiresPushedAuthorizationRequests(true); |
61 | 135 |
|
62 | 136 | String serialized = toJSON(client); |
63 | 137 | assertThat(serialized, is(notNullValue())); |
@@ -91,6 +165,7 @@ public void shouldSerialize() throws Exception { |
91 | 165 | assertThat(serialized, JsonMatcher.hasEntry("refresh_token", notNullValue())); |
92 | 166 | assertThat(serialized, JsonMatcher.hasEntry("organization_usage", "require")); |
93 | 167 | assertThat(serialized, JsonMatcher.hasEntry("organization_require_behavior", "pre_login_prompt")); |
| 168 | + assertThat(serialized, JsonMatcher.hasEntry("require_pushed_authorization_requests", true)); |
94 | 169 | } |
95 | 170 |
|
96 | 171 | @Test |
@@ -134,6 +209,7 @@ public void shouldDeserialize() throws Exception { |
134 | 209 | assertThat(client.getRefreshToken(), is(notNullValue())); |
135 | 210 | assertThat(client.getOrganizationUsage(), is("allow")); |
136 | 211 | assertThat(client.getOrganizationRequireBehavior(), is("no_prompt")); |
| 212 | + assertThat(client.getRequiresPushedAuthorizationRequests(), is(true)); |
137 | 213 | } |
138 | 214 |
|
139 | 215 | @Test |
|
0 commit comments