Class TicketGrantingTicketResource


  • @RestController("ticketResourceRestController")
    public class TicketGrantingTicketResource
    extends java.lang.Object
    RestController implementation of CAS' REST API.

    This class implements main CAS RESTful resource for vending/deleting TGTs and vending STs:

    • POST /v1/tickets
    • POST /v1/tickets/{TGT-id}
    • GET /v1/tickets/{TGT-id}
    • DELETE /v1/tickets/{TGT-id}
    Since:
    4.1.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.springframework.http.ResponseEntity<java.lang.String> createResponseEntityForTicket​(javax.servlet.http.HttpServletRequest request, org.apereo.cas.ticket.TicketGrantingTicket tgtId)
      Create response entity for ticket response entity.
      org.springframework.http.ResponseEntity<java.lang.String> createTicketGrantingTicket​(org.springframework.util.MultiValueMap<java.lang.String,​java.lang.String> requestBody, javax.servlet.http.HttpServletRequest request)
      Create new ticket granting ticket.
      protected org.apereo.cas.ticket.TicketGrantingTicket createTicketGrantingTicketForRequest​(org.springframework.util.MultiValueMap<java.lang.String,​java.lang.String> requestBody, javax.servlet.http.HttpServletRequest request)
      Create ticket granting ticket for request ticket granting ticket.
      org.springframework.http.ResponseEntity<java.lang.String> deleteTicketGrantingTicket​(java.lang.String tgtId)
      Destroy ticket granting ticket.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TicketGrantingTicketResource

        public TicketGrantingTicketResource()
    • Method Detail

      • createTicketGrantingTicket

        @PostMapping(value="/v1/tickets",
                     consumes="application/x-www-form-urlencoded")
        public org.springframework.http.ResponseEntity<java.lang.String> createTicketGrantingTicket​(@RequestBody(required=false)
                                                                                                    org.springframework.util.MultiValueMap<java.lang.String,​java.lang.String> requestBody,
                                                                                                    javax.servlet.http.HttpServletRequest request)
        Create new ticket granting ticket.
        Parameters:
        requestBody - username and password application/x-www-form-urlencoded values
        request - raw HttpServletRequest used to call this method
        Returns:
        ResponseEntity representing RESTful response
      • deleteTicketGrantingTicket

        @DeleteMapping("/v1/tickets/{tgtId:.+}")
        public org.springframework.http.ResponseEntity<java.lang.String> deleteTicketGrantingTicket​(@PathVariable("tgtId")
                                                                                                    java.lang.String tgtId)
        Destroy ticket granting ticket.
        Parameters:
        tgtId - ticket granting ticket id URI path param
        Returns:
        ResponseEntity representing RESTful response. Signals HttpStatus.OK when successful.
      • createResponseEntityForTicket

        protected org.springframework.http.ResponseEntity<java.lang.String> createResponseEntityForTicket​(javax.servlet.http.HttpServletRequest request,
                                                                                                          org.apereo.cas.ticket.TicketGrantingTicket tgtId)
                                                                                                   throws java.lang.Exception
        Create response entity for ticket response entity.
        Parameters:
        request - the request
        tgtId - the tgt id
        Returns:
        the response entity
        Throws:
        java.lang.Exception - the exception
      • createTicketGrantingTicketForRequest

        protected org.apereo.cas.ticket.TicketGrantingTicket createTicketGrantingTicketForRequest​(org.springframework.util.MultiValueMap<java.lang.String,​java.lang.String> requestBody,
                                                                                                  javax.servlet.http.HttpServletRequest request)
        Create ticket granting ticket for request ticket granting ticket.
        Parameters:
        requestBody - the request body
        request - the request
        Returns:
        the ticket granting ticket