Пример #1
0
  @GET
  @Path("audit")
  @Produces("application/json")
  public RealmAuditRepresentation getRealmAudit() {
    auth.init(RealmAuth.Resource.AUDIT).requireView();

    return ModelToRepresentation.toAuditReprensetation(realm);
  }
Пример #2
0
 public UserRepresentation getUserById(String realm, String id) {
   KeycloakSession session = server.getKeycloakSessionFactory().createSession();
   try {
     return ModelToRepresentation.toRepresentation(session.getRealmByName(realm).getUserById(id));
   } finally {
     session.close();
   }
 }
Пример #3
0
  @GET
  @NoCache
  @Produces("application/json")
  public RealmRepresentation getRealm() {
    if (auth.hasView()) {
      return ModelToRepresentation.toRepresentation(realm);
    } else {
      auth.requireAny();

      RealmRepresentation rep = new RealmRepresentation();
      rep.setRealm(realm.getName());

      return rep;
    }
  }