Beispiel #1
0
  /**
   * Get the client secret
   *
   * @return
   */
  @Path("client-secret")
  @GET
  @NoCache
  @Produces(MediaType.APPLICATION_JSON)
  public CredentialRepresentation getClientSecret() {
    auth.requireView();

    if (client == null) {
      throw new NotFoundException("Could not find client");
    }

    logger.debug("getClientSecret");
    UserCredentialModel model = UserCredentialModel.secret(client.getSecret());
    if (model == null) throw new NotFoundException("Client does not have a secret");
    return ModelToRepresentation.toRepresentation(model);
  }