Class ReadCredentialServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.wildfly.test.security.servlets.ReadCredentialServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

@WebServlet(urlPatterns="/readCredential") public class ReadCredentialServlet extends jakarta.servlet.http.HttpServlet
This servlet allows to list credential stores, aliases in them and also the secret values for the aliases.
It has optional request parameters:
  • "credentialStore" - for configuring name of credential store
  • "alias" - for configuring alias in credential store
  • "separator" - for configuring value separator when list of values is returned (default separator is the line break)

If request parameter ""credentialStore"" is not provided, list of credential store names is returned.

If request parameter ""credentialStore"" is provided and ""credentialStore"" is not provided , list of aliases in the given credential store names is returned.

If both request parameters (""credentialStore"", ""credentialStore"") are provided , secret value for given alias is returned.

If name parameter is provided but given name (store or alias) is not found, then 404 is returned as reponse status code.

Author:
Josef Cacek
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     
    protected void
    doPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPut, doTrace, getLastModified, init, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ReadCredentialServlet

      public ReadCredentialServlet()
  • Method Details

    • doPost

      protected void doPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws jakarta.servlet.ServletException, IOException
      Overrides:
      doPost in class jakarta.servlet.http.HttpServlet
      Throws:
      jakarta.servlet.ServletException
      IOException
    • doGet

      protected void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws jakarta.servlet.ServletException, IOException
      Overrides:
      doGet in class jakarta.servlet.http.HttpServlet
      Throws:
      jakarta.servlet.ServletException
      IOException