diff --git a/jans-config-api/common/src/main/java/io/jans/configapi/util/AttributeNames.java b/jans-config-api/common/src/main/java/io/jans/configapi/util/AttributeNames.java index 4b3aefc3634..2dcb60edb13 100644 --- a/jans-config-api/common/src/main/java/io/jans/configapi/util/AttributeNames.java +++ b/jans-config-api/common/src/main/java/io/jans/configapi/util/AttributeNames.java @@ -20,6 +20,7 @@ public class AttributeNames { public static final String SCOPES = "scopes"; public static final String GRANT_TYPES = "grant types"; public static final String DATA_TYPE = "dataType"; + public static final String REDIRECT_URIS = "redirectUris"; private AttributeNames() { } diff --git a/jans-config-api/docs/jans-config-api-swagger.yaml b/jans-config-api/docs/jans-config-api-swagger.yaml index da81a9d7fc7..4c6ca047ddc 100644 --- a/jans-config-api/docs/jans-config-api-swagger.yaml +++ b/jans-config-api/docs/jans-config-api-swagger.yaml @@ -1892,8 +1892,8 @@ paths: post: tags: - OAuth - OpenID Connect - Clients - summary: Create new OpenId connect client - description: Create new OpenId connect client + summary: Create new OpenId Connect client + description: Create new OpenId Connect client operationId: post-oauth-openid-clients requestBody: content: @@ -5048,10 +5048,7 @@ components: description: Client. type: object required: - - applicationType - - logout - - includeClaimsInIdToken - - displayName + - redirectUris properties: dn: type: string @@ -6061,6 +6058,10 @@ components: properties: month: type: integer + start_month: + type: integer + end_month: + type: integer monthly_active_users: type: integer format: int64 diff --git a/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/ClientsResource.java b/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/ClientsResource.java index 5f5dc9a7abd..796c57d7e90 100644 --- a/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/ClientsResource.java +++ b/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/ClientsResource.java @@ -116,7 +116,7 @@ public Response createOpenIdConnect(@Valid Client client) throws EncryptionExcep inum = inumService.generateClientInum(); client.setClientId(inum); } - checkNotNull(client.getDisplayName(), AttributeNames.DISPLAY_NAME); + checkNotNull(client.getRedirectUris(), AttributeNames.REDIRECT_URIS); //scope validation checkScopeFormat(client); @@ -148,7 +148,7 @@ public Response updateClient(@Valid Client client) throws EncryptionException { } String inum = client.getClientId(); checkNotNull(inum, AttributeNames.INUM); - checkNotNull(client.getDisplayName(), AttributeNames.DISPLAY_NAME); + checkNotNull(client.getRedirectUris(), AttributeNames.REDIRECT_URIS); Client existingClient = clientService.getClientByInum(inum); checkResourceNotNull(existingClient, OPENID_CONNECT_CLIENT); diff --git a/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/StatResource.java b/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/StatResource.java index e754cebc603..3e86e25f8ab 100644 --- a/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/StatResource.java +++ b/jans-config-api/server/src/main/java/io/jans/configapi/rest/resource/auth/StatResource.java @@ -35,8 +35,8 @@ public class StatResource extends ConfigBaseResource { @Produces(MediaType.APPLICATION_JSON) public Response getStatistics(@HeaderParam("Authorization") String authorization, @QueryParam(value = "month") String month, - @QueryParam(value = "start-month") String startMonth, - @QueryParam(value = "end-month") String endMonth, + @QueryParam(value = "start_month") String startMonth, + @QueryParam(value = "end_month") String endMonth, @QueryParam(value = "format") String format) { if (StringUtils.isBlank(format)) { format = ""; diff --git a/jans-config-api/shared/src/main/java/io/jans/configapi/core/rest/BaseResource.java b/jans-config-api/shared/src/main/java/io/jans/configapi/core/rest/BaseResource.java index 18a82e45c25..dd7cf017fcb 100644 --- a/jans-config-api/shared/src/main/java/io/jans/configapi/core/rest/BaseResource.java +++ b/jans-config-api/shared/src/main/java/io/jans/configapi/core/rest/BaseResource.java @@ -42,6 +42,12 @@ public static void checkNotNull(String attribute, String attributeName) { } } + public static void checkNotNull(String[] attributes, String attributeName) { + if (attributes == null || attributes.length <= 0) { + throw new BadRequestException(getMissingAttributeError(attributeName)); + } + } + public static void throwMissingAttributeError(String attributeName) { if (StringUtils.isNotEmpty(attributeName)) { throw new BadRequestException(getMissingAttributeError(attributeName));