Class NuxeoOAuth2Servlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class NuxeoOAuth2Servlet
    extends javax.servlet.http.HttpServlet
    Since:
    9.2
    See Also:
    Serialized Form
    • Constructor Detail

      • NuxeoOAuth2Servlet

        public NuxeoOAuth2Servlet()
    • Method Detail

      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws javax.servlet.ServletException,
                             IOException
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • doPost

        protected void doPost​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws javax.servlet.ServletException,
                              IOException
        Overrides:
        doPost in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • doGetAuthorize

        protected void doGetAuthorize​(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.http.HttpServletResponse response)
                               throws IOException,
                                      javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • doGetNotAllowed

        protected void doGetNotAllowed​(String endpoint,
                                       javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response)
                                throws IOException,
                                       javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • doPostAuthorizeSubmit

        protected void doPostAuthorizeSubmit​(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)
                                      throws IOException,
                                             javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • getRedirectURI

        protected String getRedirectURI​(AuthorizationRequest authRequest)
        Returns the redirect URI included in the given authorization request or fall back on the first one registered for the related client.
      • doPostToken

        protected void doPostToken​(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
                            throws IOException
        Throws:
        IOException
      • getAndSendToken

        protected void getAndSendToken​(javax.servlet.http.HttpServletResponse response,
                                       String clientId,
                                       String username)
                                throws IOException
        Throws:
        IOException
      • handleError

        protected void handleError​(OAuth2Error error,
                                   javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
                            throws IOException,
                                   javax.servlet.ServletException
        Throws:
        IOException
        javax.servlet.ServletException
      • handleError

        @Deprecated
        protected void handleError​(OAuth2Error error,
                                   int status,
                                   javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
                            throws IOException,
                                   javax.servlet.ServletException
        Deprecated.
        since 2021.23, OAuth2Error now contains the status code to give to the response
        Throws:
        IOException
        javax.servlet.ServletException
      • sendRedirect

        protected void sendRedirect​(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    String redirectURI,
                                    Map<String,​String> params)
                             throws IOException
        Throws:
        IOException