naeem
September 27, 2018, 12:43pm
1
Hi,
I have the following code, running in flowable-task:
List<RemoteUser> users = remoteIdmService.findUsersByGroup(groupId);
which calls the following in RemoteIdmServiceImpl:
JsonNode json = callRemoteIdmService(url + "/api/idm/groups/" + encode(groupId) + "/users", adminUser, adminPassword);
And this shows in the flowable-idm logs:
2018-09-27 07:43:17,062 [qtp1232367853-15] WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/flowable-idm/api/idm/groups/mygroup/users] in DispatcherServlet with name ‘apiDispatcher’
Upon further investigation I see this isn’t implemented in flowable-ui-idm-rest ApiGroupsResource
Using flowable 6.2.1
is this a bug or am I missing something?
Thanks.
naeem
September 27, 2018, 1:35pm
2
Tried: http://localhost:8080/flowable-idm/app/rest/admin/groups/mygroup/users
returns exception:
<h2>HTTP ERROR 500</h2>
<p>Problem accessing /flowable-idm/app/rest/admin/groups/mygroup/users. Reason:
<pre> Server Error</pre>
</p>
<h3>Caused by:</h3>
<pre>javax.servlet.ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
</pre>
<h3>Caused by:</h3>
<pre>java.lang.NullPointerException
at org.flowable.app.rest.idm.IdmGroupsResource.getGroupUsers(IdmGroupsResource.java:71)
</pre>
naeem
October 2, 2018, 3:18am
3
Fixed by adding following to flowable-ui-idm-rest # ApiGroupsResource:
@RequestMapping(value = "/idm/groups/{groupId}/users", method = RequestMethod.GET, produces = {"application/json"})
public List<UserRepresentation> findUsersByGroup(@PathVariable String groupId,
@RequestParam(value = "filter", required = false) String filter,
@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
List<UserRepresentation> result = new ArrayList<>();
List<User> users = groupService.getGroupUsers(groupId, filter, page, pageSize);
for (User user : users) {
result.add(new UserRepresentation(user));
}
return result;
}
But it still doesn’t make sense that this entire group of functions is missing from remoteIdmService.
naeem
November 6, 2018, 10:44pm
4
Hi. Any comments? Wondering if there is a solution or fix for this?
naeem
November 20, 2018, 1:47am
5
Hi. Looking forward to any thoughts on this.
filiphr
November 26, 2018, 7:27am
6
Hey @naeem ,
Yes it seems like the /idm/groups/{groupId}/users
is not implemented in the IDM UI App.
The solution would be too add a GET /idm/groups/{groupId}/users
in the ApiGroupsResource
of the IDM UI App.
Would you like to do this contribution?
Cheers,
Filip