Beispiel #1
0
 /**
  * Retrieve full user information given a user id (a.k.a. username). If there are multiple user
  * backing stores configured, information from each will be aggregated. The provider with the
  * highest priority will be used to provide based information, but then each separate provider is
  * added as a property.
  *
  * <p>For example, if you have an LDAP provider called "ldap" and a databse provider called "db",
  * with the ldap provider being the default (high priority), you would get something that looks
  * like <code>{ "hasUsername":id, "FirstName":"John",
  * "ldap":{...all LDAP user attributes }, "db":{ all DB user attributes}}</code>
  *
  * @param id
  * @return
  */
 @GET
 @Path("{id}")
 @Produces("application/json")
 public Json getUserById(@PathParam("id") String id) {
   Json user = Json.object("userid", id);
   List<String> plist = orderedProviders();
   for (String providerName : plist) {
     UserProvider P = provider(providerName);
     P.populate(user);
   }
   return ok().set("profile", prepareReturn(user));
 }