Class ConsumersService

java.lang.Object
org.eclipse.lyo.server.oauth.webapp.services.ConsumersService

@Path("/oauth/consumers") public class ConsumersService extends Object
Manages OAuth consumers for this provider.
Author:
Samuel Padgett
  • Field Details

    • httpRequest

      @Context protected jakarta.servlet.http.HttpServletRequest httpRequest
    • httpResponse

      @Context protected jakarta.servlet.http.HttpServletResponse httpResponse
  • Constructor Details

    • ConsumersService

      public ConsumersService()
  • Method Details

    • getAllConsumers

      @GET @Produces("application/json") public jakarta.ws.rs.core.Response getAllConsumers() throws org.apache.wink.json4j.JSONException
      Throws:
      org.apache.wink.json4j.JSONException
    • updateConsumer

      @POST @Path("/{key}") @Consumes("application/x-www-form-urlencoded") public jakarta.ws.rs.core.Response updateConsumer(@PathParam("key") String key, @FormParam("name") String name, @FormParam("trusted") String trusted, @FormParam("provisional") String provisional)
      Updates an OAuth consumer.
      Parameters:
      key - the consumer key
      name - the new name or null
      trusted - "true" the consumer is trusted. Can be null.
      provisional - "true" if the consumer is provisional or "false" if the consumer is authorized. Can be null.
      Returns:
      the HTTP response
    • removeConsumer

      @DELETE @Path("/{key}") public jakarta.ws.rs.core.Response removeConsumer(@PathParam("key") String key)
      Deletes an OAuth consumer.
      Parameters:
      key - the consumer key
      Returns:
      the HTTP response
    • handleConsumerStoreException

      protected jakarta.ws.rs.core.Response handleConsumerStoreException(ConsumerStoreException e)
    • asJson

      protected org.apache.wink.json4j.JSONObject asJson(LyoOAuthConsumer consumer) throws org.apache.wink.json4j.JSONException
      Throws:
      org.apache.wink.json4j.JSONException