Deprecated UserClientDto and uses ClientinfoDto instead.
Change-Id: If9a146284a1f0ca9237e35a0ad36dfbb4ddefcda
diff --git a/full/Changes b/full/Changes
index f5b9476..de3175a 100644
--- a/full/Changes
+++ b/full/Changes
@@ -9,7 +9,9 @@
- Added a new API: install plugin
- Handled redundant plugin installation
- Handled super client id in plugin installation
-
+ - Deprecated UserClientDto and uses ClientinfoDto instead
+
+
# version 0.67.1
2022-05-12
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2ClientInfoDto.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2ClientInfoDto.java
index 69cf45f..d50d79b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2ClientInfoDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2ClientInfoDto.java
@@ -1,5 +1,7 @@
package de.ids_mannheim.korap.oauth2.dto;
+import java.time.ZonedDateTime;
+
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -10,93 +12,73 @@
import de.ids_mannheim.korap.oauth2.entity.OAuth2Client;
import de.ids_mannheim.korap.utils.JsonUtils;
-/** Describes information about an OAuth2 client.
+/**
+ * Describes information about an OAuth2 client.
*
* @author margaretha
*
*/
@JsonInclude(Include.NON_EMPTY)
public class OAuth2ClientInfoDto {
+ @JsonProperty("super")
+ private boolean isSuper;
- private String id;
- private String name;
+ @JsonProperty("client_id")
+ private String clientId;
+ @JsonProperty("client_name")
+ private String clientName;
+ @JsonProperty("client_type")
+ private OAuth2ClientType clientType;
+ @JsonProperty("client_description")
private String description;
- @JsonProperty("is_super")
- private String isSuper;
+ @JsonProperty("client_url")
private String url;
+ @JsonProperty("client_redirect_uri")
private String redirect_uri;
- @JsonProperty("registered_by")
- private String registeredBy;
@JsonProperty("registration_date")
private String registrationDate;
+ @JsonProperty("registered_by")
+ private String registeredBy;
@JsonProperty("refresh_token_expiry")
private int refreshTokenExpiry; // in seconds
- private OAuth2ClientType type;
-
+
@JsonProperty("permitted")
private boolean isPermitted;
private JsonNode source;
public OAuth2ClientInfoDto (OAuth2Client client) throws KustvaktException {
- this.id = client.getId();
- this.name = client.getName();
- this.description = client.getDescription();
- this.setType(client.getType());
- this.url = client.getUrl();
- this.registeredBy = client.getRegisteredBy();
- this.redirect_uri = client.getRedirectURI();
- this.registrationDate = client.getRegistrationDate().toString();
- this.isPermitted = client.isPermitted();
+ this.setClientId(client.getId());
+ this.setClientName(client.getName());
+ this.setDescription(client.getDescription());
+ this.setClientType(client.getType());
+ this.setUrl(client.getUrl());
+ this.setClientType(client.getType());
+ this.setRedirect_uri(client.getRedirectURI());
+ this.setSuper(client.isSuper());
+ this.setPermitted(client.isPermitted());
+ this.setRegisteredBy(client.getRegisteredBy());
+
String source = client.getSource();
- if (source != null) {
+ if (source != null && !source.isEmpty()) {
this.source = JsonUtils.readTree(source);
}
- if (client.isSuper()) {
- this.isSuper = "true";
+ if (client.getType().equals(OAuth2ClientType.CONFIDENTIAL)) {
+ this.setRefreshTokenExpiry(client.getRefreshTokenExpiry());
}
- this.refreshTokenExpiry = client.getRefreshTokenExpiry();
+ ZonedDateTime registrationDate = client.getRegistrationDate();
+ if (registrationDate != null) {
+ this.setRegistrationDate(registrationDate.toString());
+ }
}
- public String getId () {
- return id;
- }
-
- public void setId (String id) {
- this.id = id;
- }
-
- public String getName () {
- return name;
- }
-
- public void setName (String name) {
- this.name = name;
- }
-
- public String getDescription () {
- return description;
- }
-
- public void setDescription (String description) {
- this.description = description;
- }
-
- public String getIsSuper () {
+ public boolean isSuper () {
return isSuper;
}
- public void setIsSuper (String isSuper) {
+ public void setSuper (boolean isSuper) {
this.isSuper = isSuper;
}
- public String getUrl () {
- return url;
- }
-
- public void setUrl (String url) {
- this.url = url;
- }
-
public String getRegisteredBy () {
return registeredBy;
}
@@ -105,12 +87,44 @@
this.registeredBy = registeredBy;
}
- public OAuth2ClientType getType () {
- return type;
+ public String getClientId () {
+ return clientId;
}
- public void setType (OAuth2ClientType type) {
- this.type = type;
+ public void setClientId (String clientId) {
+ this.clientId = clientId;
+ }
+
+ public String getClientName () {
+ return clientName;
+ }
+
+ public void setClientName (String clientName) {
+ this.clientName = clientName;
+ }
+
+ public OAuth2ClientType getClientType () {
+ return clientType;
+ }
+
+ public void setClientType (OAuth2ClientType clientType) {
+ this.clientType = clientType;
+ }
+
+ public String getDescription () {
+ return description;
+ }
+
+ public void setDescription (String description) {
+ this.description = description;
+ }
+
+ public String getUrl () {
+ return url;
+ }
+
+ public void setUrl (String url) {
+ this.url = url;
}
public String getRedirect_uri () {
@@ -120,33 +134,36 @@
public void setRedirect_uri (String redirect_uri) {
this.redirect_uri = redirect_uri;
}
-
+
public String getRegistrationDate () {
return registrationDate;
}
+
public void setRegistrationDate (String registrationDate) {
this.registrationDate = registrationDate;
}
-
- public JsonNode getSource () {
- return source;
- }
- public void setSource (JsonNode source) {
- this.source = source;
- }
-
- public boolean isPermitted () {
- return isPermitted;
- }
- public void setPermitted (boolean isPermitted) {
- this.isPermitted = isPermitted;
- }
-
+
public int getRefreshTokenExpiry () {
return refreshTokenExpiry;
}
+
public void setRefreshTokenExpiry (int refreshTokenExpiry) {
this.refreshTokenExpiry = refreshTokenExpiry;
}
+ public boolean isPermitted () {
+ return isPermitted;
+ }
+
+ public void setPermitted (boolean isPermitted) {
+ this.isPermitted = isPermitted;
+ }
+
+ public JsonNode getSource () {
+ return source;
+ }
+
+ public void setSource (JsonNode source) {
+ this.source = source;
+ }
}
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2UserClientDto.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2UserClientDto.java
index 8a9c6fd..c417a60 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2UserClientDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dto/OAuth2UserClientDto.java
@@ -11,11 +11,14 @@
import de.ids_mannheim.korap.utils.JsonUtils;
/**
- * Lists OAuth2 clients of a user
+ * Please use {@link OAuth2ClientInfoDto} instead.
+ *
+ * This class is not used anymore to describe OAuth2 clients of a user.
*
* @author margaretha
*
*/
+@Deprecated
@JsonInclude(Include.NON_DEFAULT)
public class OAuth2UserClientDto {
@JsonProperty("client_id")
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ClientService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ClientService.java
index 078219a..47ba029 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ClientService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ClientService.java
@@ -30,7 +30,6 @@
import de.ids_mannheim.korap.oauth2.dao.RefreshTokenDao;
import de.ids_mannheim.korap.oauth2.dto.OAuth2ClientDto;
import de.ids_mannheim.korap.oauth2.dto.OAuth2ClientInfoDto;
-import de.ids_mannheim.korap.oauth2.dto.OAuth2UserClientDto;
import de.ids_mannheim.korap.oauth2.entity.AccessToken;
import de.ids_mannheim.korap.oauth2.entity.Authorization;
import de.ids_mannheim.korap.oauth2.entity.OAuth2Client;
@@ -354,7 +353,7 @@
return clientDao.retrieveClientById(clientId);
}
- public List<OAuth2UserClientDto> listUserAuthorizedClients (String username)
+ public List<OAuth2ClientInfoDto> listUserAuthorizedClients (String username)
throws KustvaktException {
List<OAuth2Client> userClients =
clientDao.retrieveUserAuthorizedClients(username);
@@ -374,7 +373,7 @@
return createClientDtos(uniqueClients);
}
- public List<OAuth2UserClientDto> listUserRegisteredClients (String username)
+ public List<OAuth2ClientInfoDto> listUserRegisteredClients (String username)
throws KustvaktException {
List<OAuth2Client> userClients =
clientDao.retrieveUserRegisteredClients(username);
@@ -383,7 +382,7 @@
}
- public List<OAuth2UserClientDto> listPlugins (boolean isPermitted)
+ public List<OAuth2ClientInfoDto> listPlugins (boolean isPermitted)
throws KustvaktException {
List<OAuth2Client> plugins = clientDao.retrievePlugins(isPermitted);
@@ -428,12 +427,12 @@
return true;
}
- private List<OAuth2UserClientDto> createClientDtos (
+ private List<OAuth2ClientInfoDto> createClientDtos (
List<OAuth2Client> userClients) throws KustvaktException {
- List<OAuth2UserClientDto> dtoList = new ArrayList<>(userClients.size());
+ List<OAuth2ClientInfoDto> dtoList = new ArrayList<>(userClients.size());
for (OAuth2Client uc : userClients) {
if (uc.isSuper()) continue;
- OAuth2UserClientDto dto = new OAuth2UserClientDto(uc);
+ OAuth2ClientInfoDto dto = new OAuth2ClientInfoDto(uc);
dtoList.add(dto);
}
return dtoList;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java
index e8f634b..ed380d9 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java
@@ -25,7 +25,6 @@
import de.ids_mannheim.korap.exceptions.KustvaktException;
import de.ids_mannheim.korap.oauth2.dto.OAuth2ClientDto;
import de.ids_mannheim.korap.oauth2.dto.OAuth2ClientInfoDto;
-import de.ids_mannheim.korap.oauth2.dto.OAuth2UserClientDto;
import de.ids_mannheim.korap.oauth2.service.OAuth2ClientService;
import de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService;
import de.ids_mannheim.korap.security.context.TokenContext;
@@ -207,7 +206,7 @@
@Path("/list")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
- public List<OAuth2UserClientDto> listUserClients (
+ public List<OAuth2ClientInfoDto> listUserClients (
@Context SecurityContext context,
@FormParam("super_client_id") String superClientId,
@FormParam("super_client_secret") String superClientSecret,
@@ -237,7 +236,7 @@
@Path("/plugins")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
- public List<OAuth2UserClientDto> listPlugins (
+ public List<OAuth2ClientInfoDto> listPlugins (
@Context SecurityContext context,
@FormParam("super_client_id") String superClientId,
@FormParam("super_client_secret") String superClientSecret,
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/input/OAuth2ClientJson.java b/full/src/main/java/de/ids_mannheim/korap/web/input/OAuth2ClientJson.java
index 7180eda..e6b4490 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/input/OAuth2ClientJson.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/input/OAuth2ClientJson.java
@@ -31,6 +31,7 @@
@JsonProperty("redirect_uri")
private String redirectURI;
// Default 365 days
+ @JsonProperty("refresh_token_expiry")
private int refreshTokenExpiry; // in seconds
// plugins
diff --git a/full/src/main/resources/db/test/V3.5__insert_oauth2_clients.sql b/full/src/main/resources/db/test/V3.5__insert_oauth2_clients.sql
index 4e803d2..6b318e3 100644
--- a/full/src/main/resources/db/test/V3.5__insert_oauth2_clients.sql
+++ b/full/src/main/resources/db/test/V3.5__insert_oauth2_clients.sql
@@ -8,7 +8,7 @@
"$2a$08$vi1FbuN3p6GcI1tSxMAoeuIYL8Yw3j6A8wJthaN8ZboVnrQaTwLPq",
"CONFIDENTIAL", 1,
"https://korap.ids-mannheim.de/confidential/redirect", "system",
- "This is a test super confidential client.",
+ "Super confidential client.",
"http://korap.ids-mannheim.de/confidential", CURRENT_TIMESTAMP, 1);
@@ -20,7 +20,7 @@
"$2a$08$vi1FbuN3p6GcI1tSxMAoeuIYL8Yw3j6A8wJthaN8ZboVnrQaTwLPq",
"CONFIDENTIAL", 0,
"https://third.party.com/confidential/redirect", "system",
- "This is a test nonsuper confidential client.",
+ "Nonsuper confidential client.",
"http://third.party.com/confidential", CURRENT_TIMESTAMP,1);
INSERT INTO oauth2_client(id,name,secret,type,super,
@@ -29,7 +29,7 @@
VALUES ("52atrL0ajex_3_5imd9Mgw","confidential client 2",
"$2a$08$vi1FbuN3p6GcI1tSxMAoeuIYL8Yw3j6A8wJthaN8ZboVnrQaTwLPq",
"CONFIDENTIAL", 0,"system",
- "This is a test nonsuper confidential client.",
+ "Nonsuper confidential client plugin without redirect URI",
"http://example.client.de", CURRENT_TIMESTAMP, 1,'{"key":"value"}');
INSERT INTO oauth2_client(id,name,secret,type,super,
@@ -38,7 +38,7 @@
VALUES ("8bIDtZnH6NvRkW2Fq","public client plugin with redirect uri",
null, "PUBLIC", 0,
"https://third.party.client.com/redirect","system",
- "A public client that is a plugin with registered redirect URI",
+ "Public client plugin with a registered redirect URI",
"http://third.party.client.com", CURRENT_TIMESTAMP,1,'{"key":"value"}');
@@ -46,7 +46,7 @@
registered_by, description, url, registration_date,
is_permitted)
VALUES ("nW5qM63Rb2a7KdT9L","test public client",null,
- "PUBLIC", 0, "without redirect uri",
+ "PUBLIC", 0, "Public client without redirect uri",
"system", "http://korap.ids-mannheim.de/public",
CURRENT_TIMESTAMP, 1);
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
index b656b63..958542b 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AdminControllerTest.java
@@ -146,7 +146,7 @@
String accessToken) throws KustvaktException {
JsonNode node = retrieveClientInfo(clientId, "admin");
- assertTrue(node.at("/is_super").asBoolean());
+ assertTrue(node.at("/super").asBoolean());
// list vc
ClientResponse response = resource().path(API_VERSION).path("vc")
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java
index 0ea7f10..7ea1485 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2ClientControllerTest.java
@@ -81,33 +81,33 @@
public void testRetrieveClientInfo () throws KustvaktException {
// public client
JsonNode clientInfo = retrieveClientInfo(publicClientId, "system");
- assertEquals(publicClientId, clientInfo.at("/id").asText());
+ assertEquals(publicClientId, clientInfo.at("/client_id").asText());
assertEquals("public client plugin with redirect uri",
- clientInfo.at("/name").asText());
- assertNotNull(clientInfo.at("/description"));
- assertNotNull(clientInfo.at("/url"));
- assertEquals("PUBLIC", clientInfo.at("/type").asText());
+ clientInfo.at("/client_name").asText());
+ assertNotNull(clientInfo.at("/client_description"));
+ assertNotNull(clientInfo.at("/client_url"));
+ assertEquals("PUBLIC", clientInfo.at("/client_type").asText());
assertEquals("system", clientInfo.at("/registered_by").asText());
// confidential client
clientInfo = retrieveClientInfo(confidentialClientId, "system");
- assertEquals(confidentialClientId, clientInfo.at("/id").asText());
+ assertEquals(confidentialClientId, clientInfo.at("/client_id").asText());
assertEquals("non super confidential client",
- clientInfo.at("/name").asText());
- assertNotNull(clientInfo.at("/url"));
+ clientInfo.at("/client_name").asText());
+ assertNotNull(clientInfo.at("/client_url"));
assertNotNull(clientInfo.at("/redirect_uri"));
- assertEquals(false, clientInfo.at("/is_super").asBoolean());
- assertEquals("CONFIDENTIAL", clientInfo.at("/type").asText());
+ assertEquals(false, clientInfo.at("/super").asBoolean());
+ assertEquals("CONFIDENTIAL", clientInfo.at("/client_type").asText());
// super client
clientInfo = retrieveClientInfo(superClientId, "system");
- assertEquals(superClientId, clientInfo.at("/id").asText());
+ assertEquals(superClientId, clientInfo.at("/client_id").asText());
assertEquals("super confidential client",
- clientInfo.at("/name").asText());
- assertNotNull(clientInfo.at("/url"));
+ clientInfo.at("/client_name").asText());
+ assertNotNull(clientInfo.at("/client_url"));
assertNotNull(clientInfo.at("/redirect_uri"));
- assertEquals("CONFIDENTIAL", clientInfo.at("/type").asText());
- assertTrue(clientInfo.at("/is_super").asBoolean());
+ assertEquals("CONFIDENTIAL", clientInfo.at("/client_type").asText());
+ assertTrue(clientInfo.at("/super").asBoolean());
}
@Test
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java
index ff63cc1..34081a5 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2PluginTest.java
@@ -28,6 +28,7 @@
import de.ids_mannheim.korap.oauth2.constant.OAuth2Error;
import de.ids_mannheim.korap.oauth2.dao.InstalledPluginDao;
import de.ids_mannheim.korap.utils.JsonUtils;
+import de.ids_mannheim.korap.utils.TimeUtils;
import de.ids_mannheim.korap.web.input.OAuth2ClientJson;
public class OAuth2PluginTest extends OAuth2TestBase {
@@ -42,12 +43,15 @@
ClientHandlerException, KustvaktException {
JsonNode source = JsonUtils.readTree("{ \"plugin\" : \"source\"}");
+ int refreshTokenExpiry = TimeUtils.convertTimeToSeconds("90D");
+
String clientName = "Plugin";
OAuth2ClientJson json = new OAuth2ClientJson();
json.setName(clientName);
json.setType(OAuth2ClientType.CONFIDENTIAL);
json.setDescription("This is a plugin test client.");
json.setSource(source);
+ json.setRefreshTokenExpiry(refreshTokenExpiry);
ClientResponse response = registerClient(username, json);
assertEquals(Status.OK.getStatusCode(), response.getStatus());
@@ -58,37 +62,38 @@
assertNotNull(clientSecret);
testInstallPluginNotPermitted(clientId);
- testRetrievePluginInfo(clientId);
+ testRetrievePluginInfo(clientId,refreshTokenExpiry);
node = listPlugins(false);
assertEquals(3, node.size());
node = listPlugins(true); // permitted only
assertEquals(2, node.size());
- testListUserRegisteredPlugins(username, clientId, clientName);
+ testListUserRegisteredPlugins(username, clientId, clientName,
+ refreshTokenExpiry);
deregisterConfidentialClient(username, clientId);
}
- private void testRetrievePluginInfo (String clientId)
+ private void testRetrievePluginInfo (String clientId, int refreshTokenExpiry)
throws UniformInterfaceException, ClientHandlerException,
KustvaktException {
JsonNode clientInfo = retrieveClientInfo(clientId, username);
- assertEquals(clientId, clientInfo.at("/id").asText());
- assertEquals("Plugin", clientInfo.at("/name").asText());
+ assertEquals(clientId, clientInfo.at("/client_id").asText());
+ assertEquals("Plugin", clientInfo.at("/client_name").asText());
assertEquals(OAuth2ClientType.CONFIDENTIAL.name(),
- clientInfo.at("/type").asText());
- assertNotNull(clientInfo.at("/description").asText());
+ clientInfo.at("/client_type").asText());
+ assertNotNull(clientInfo.at("/client_description").asText());
assertNotNull(clientInfo.at("/source").asText());
assertFalse(clientInfo.at("/permitted").asBoolean());
assertEquals(username, clientInfo.at("/registered_by").asText());
assertNotNull(clientInfo.at("/registration_date"));
- assertEquals(defaultRefreshTokenExpiry,
+ assertEquals(refreshTokenExpiry,
clientInfo.at("/refresh_token_expiry").asInt());
}
private void testListUserRegisteredPlugins (String username,
- String clientId, String clientName)
+ String clientId, String clientName, int refreshTokenExpiry)
throws UniformInterfaceException, ClientHandlerException,
KustvaktException {
@@ -101,7 +106,7 @@
assertFalse(node.at("/0/permitted").asBoolean());
assertFalse(node.at("/0/registration_date").isMissingNode());
assertFalse(node.at("/0/source").isMissingNode());
- assertEquals(defaultRefreshTokenExpiry,
+ assertEquals(refreshTokenExpiry,
node.at("/0/refresh_token_expiry").asInt());
}
@@ -204,7 +209,7 @@
assertFalse(node.at("/0/source").isMissingNode());
assertFalse(node.at("/0/refresh_token_expiry").isMissingNode());
- assertTrue(node.at("/1/refresh_token_expiry").isMissingNode());
+// assertTrue(node.at("/1/refresh_token_expiry").isMissingNode());
}
private JsonNode listPlugins (boolean permitted_only)
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java
index 45f02b4..6526190 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2TestBase.java
@@ -269,16 +269,16 @@
throws UniformInterfaceException, ClientHandlerException,
KustvaktException {
JsonNode clientInfo = retrieveClientInfo(clientId, username);
- assertEquals(clientId, clientInfo.at("/id").asText());
- assertEquals("OAuth2ClientTest", clientInfo.at("/name").asText());
+ assertEquals(clientId, clientInfo.at("/client_id").asText());
+ assertEquals("OAuth2ClientTest", clientInfo.at("/client_name").asText());
assertEquals(OAuth2ClientType.CONFIDENTIAL.name(),
- clientInfo.at("/type").asText());
+ clientInfo.at("/client_type").asText());
assertEquals(username, clientInfo.at("/registered_by").asText());
- assertEquals(clientURL, clientInfo.at("/url").asText());
+ assertEquals(clientURL, clientInfo.at("/client_url").asText());
assertEquals(clientRedirectUri,
- clientInfo.at("/redirect_uri").asText());
+ clientInfo.at("/client_redirect_uri").asText());
// 31536000 seconds
- assertEquals(TimeUtils.convertTimeToSeconds("365D"),
+ assertEquals(defaultRefreshTokenExpiry,
clientInfo.at("/refresh_token_expiry").asInt());
assertNotNull(clientInfo.at("/description"));
assertNotNull(clientInfo.at("/registration_date"));