code: @PostMapping(value = "/v1/users", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
      public ResponseEntity<String> createTicketGrantingTicket(@RequestBody final MultiValueMap<String, String> requestBody,
                                                               final HttpServletRequest request) {
          try {
              val credential = this.credentialFactory.fromRequest(request, requestBody);
              if (credential == null || credential.isEmpty()) {
                  throw new BadRestRequestException("No credentials are provided or extracted to authenticate the REST request");
              }
              val service = this.serviceFactory.createService(request);
              val authenticationResult =
                  authenticationSystemSupport.handleAndFinalizeSingleAuthenticationTransaction(service, credential);
              if (authenticationResult == null) {
                  throw new FailedLoginException("Authentication failed");
              }
              return this.userAuthenticationResourceEntityResponseFactory.build(authenticationResult, request);
          } catch (final AuthenticationException e) {
              return RestResourceUtils.createResponseEntityForAuthnFailure(e, request, applicationContext);
          } catch (final BadRestRequestException e) {
              LOGGER.error(e.getMessage(), e);
              return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
          } catch (final Exception e) {
              LOGGER.error(e.getMessage(), e);
              return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
          }
      }
docs: Create new ticket granting ticket.
  
  @param requestBody username and password application/x-www-form-urlencoded values
  @param request     raw HttpServletRequest used to call this method
  @return ResponseEntity representing RESTful response