Class OA2ATServlet

    • Constructor Detail

      • OA2ATServlet

        public OA2ATServlet()
    • Method Detail

      • destroy

        public void destroy()
        Specified by:
        destroy in interface javax.servlet.Servlet
        Overrides:
        destroy in class OA4MPServlet
      • executeByGrant

        protected boolean executeByGrant​(String grantType,
                                         javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response)
                                  throws Throwable
        Contains the tests for executing a request based on its grant type. over-ride this as needed by writing your code then calling super. Return true is the request is serviced and false otherwise. This is invoked in the doIt(HttpServletRequest, HttpServletResponse) method. If a grant is given' that is not supported in this method, the servlet should reject the request, as per the OAuth 2 spec.
        Parameters:
        request -
        response -
        Throws:
        Throwable
      • doRFC6749_4_4

        protected void doRFC6749_4_4​(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response,
                                     OA2Client client)
                              throws Throwable
        Does client credential flow
        Parameters:
        request -
        response -
        client -
        Throws:
        Throwable
      • getRFC7523Client

        protected OA2Client getRFC7523Client​(BaseClient baseClient,
                                             net.sf.json.JSONObject jsonRequest)
      • doRFC7523InitiateFlow

        protected void doRFC7523InitiateFlow​(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response,
                                             BaseClient adminBaseClient)
                                      throws Throwable
        Processes a request from a service client. This allows for getting tokens from a trusted client directly from the token endpoint by sending in the authorization grant request directly.
        Parameters:
        request -
        response -
        adminBaseClient -
        Throws:
        Throwable
      • doRFC7523

        protected void doRFC7523​(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 OA2Client client)
                          throws Throwable
        Processes a request from a service client. This allows for getting tokens from a trusted client directly from the token endpoint by sending in the authorization grant request directly.
        Parameters:
        request -
        response -
        client -
        Throws:
        Throwable
      • setUsername

        protected void setUsername​(OA2ServiceTransaction serviceTransaction,
                                   OA2Client client,
                                   String user)
        Checks if the user name is allowed for this client and if so sets it, if not an exception is raised.
        Parameters:
        serviceTransaction -
        client -
        user -
      • createErsatz

        protected OA2Client createErsatz​(edu.uiuc.ncsa.security.core.Identifier provisioningClientID,
                                         OA2Client ersatzClient,
                                         List<edu.uiuc.ncsa.security.core.Identifier> ersatzChain)
        Takes a substitution chain and does the overrides. Any int or long < 0 is assumed unset and is skipped.
        Parameters:
        provisioningClientID -
        ersatzClient -
        ersatzChain -
        Returns:
      • convertToList

        protected List<String> convertToList​(javax.servlet.http.HttpServletRequest req,
                                             String parameterName)
        Convert a string or list of strings to a list of them. This is for lists of space delimited values The spec allows for multiple value which in practice can also mean that a client makes the request with multiple parameters, so we have to snoop for those and for space delimited strings inside of those. This is used by RFC 8693 and specific to it.
        Parameters:
        req -
        parameterName -
        Returns:
      • convertToURIList

        protected List<URI> convertToURIList​(javax.servlet.http.HttpServletRequest req,
                                             String parameterName)
      • getOA2SE

        protected OA2SE getOA2SE()
      • rollback

        protected void rollback​(edu.uiuc.ncsa.security.storage.XMLMap backup)
                         throws IOException
        Throws:
        IOException
      • listToString

        protected String listToString​(List scopes)
      • doRFC8628

        protected void doRFC8628​(OA2Client client,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws Throwable
        device flow
        Parameters:
        client -
        request -
        response -
        Throws:
        Throwable