Class BaseAccessTokenController

    • Field Detail

      • myWebLinks

        @NotNull
        protected final WebLinks myWebLinks
      • myOAuthFlow

        @NotNull
        protected final OAuthFlow myOAuthFlow
      • myIssueTokenService

        @Nullable
        protected final IssueTokenService myIssueTokenService
    • Method Detail

      • registerController

        protected void registerController​(@NotNull
                                          WebControllerManager webControllerManager)
        Register this controller under the path myPath. Unique redirect URLs will not be supported for this controller.
        Parameters:
        webControllerManager - web controller manager to use
      • registerController

        protected void registerController​(@NotNull
                                          WebControllerManager webControllerManager,
                                          @Nullable
                                          String typeForUniqueRedirect)
        Register this controller under the path myPath. If unique redirect URLs should be supported, the type parameter must be specified too. This will register this controller also under a path structured like this:
        /oauth/{typeForUniqueRedirect}/rid:{redirectId}/accessToken.html
        Example with type = bitbucket:
        /oauth/bitbucket/rid:wi82wkwerif234f/accessToken.html
        Parameters:
        webControllerManager - web controller manager to use
        typeForUniqueRedirect - controller / provider type; needs to be specified if unique redirects should be supported
        Since:
        2024.03
        See Also:
        UniqueRedirectUtil#buildControllerPath(String)
      • doHandle

        @Nullable
        protected org.springframework.web.servlet.ModelAndView doHandle​(@NotNull
                                                                        javax.servlet.http.HttpServletRequest request,
                                                                        @NotNull
                                                                        javax.servlet.http.HttpServletResponse response)
                                                                 throws Exception
        Description copied from class: BaseController
        Performs actual request processing
        Specified by:
        doHandle in class BaseController
        Parameters:
        request - HTTP request
        response - HTTP response
        Returns:
        model and view components
        Throws:
        Exception - exception
      • obtainToken

        @Nullable
        protected abstract org.springframework.web.servlet.ModelAndView obtainToken​(@NotNull
                                                                                    javax.servlet.http.HttpServletRequest request,
                                                                                    @NotNull
                                                                                    javax.servlet.http.HttpServletResponse response)
                                                                             throws Exception
        Redirect the user to the oauth provider
        Throws:
        Exception
      • completeAuthorization

        @NotNull
        protected abstract org.springframework.web.servlet.ModelAndView completeAuthorization​(@NotNull
                                                                                              javax.servlet.http.HttpServletRequest request,
                                                                                              @NotNull
                                                                                              javax.servlet.http.HttpServletResponse response,
                                                                                              @NotNull
                                                                                              Map<String,​String> stateContainer)
                                                                                       throws Exception
        Throws:
        Exception
      • beforeCompleteAuthorization

        @Nullable
        protected org.springframework.web.servlet.ModelAndView beforeCompleteAuthorization​(@NotNull
                                                                                           javax.servlet.http.HttpServletRequest request,
                                                                                           @NotNull
                                                                                           javax.servlet.http.HttpServletResponse response,
                                                                                           @NotNull
                                                                                           Map<String,​String> stateContainer)
                                                                                    throws Exception
        Throws:
        Exception
      • handleMissingAction

        @Nullable
        protected org.springframework.web.servlet.ModelAndView handleMissingAction​(@NotNull
                                                                                   javax.servlet.http.HttpServletRequest request,
                                                                                   @NotNull
                                                                                   javax.servlet.http.HttpServletResponse response)
                                                                            throws Exception
        Throws:
        Exception
      • internalRedirect

        @NotNull
        protected org.springframework.web.servlet.ModelAndView internalRedirect​(@NotNull
                                                                                javax.servlet.http.HttpServletRequest request,
                                                                                @NotNull
                                                                                String callbackUrl)
      • createStateContainer

        @NotNull
        protected Map<String,​String> createStateContainer​(@NotNull
                                                                javax.servlet.http.HttpServletRequest request,
                                                                @NotNull
                                                                String projectId,
                                                                @NotNull
                                                                String connectionId)
        Creates a state container with common values. The returned Map is mutable, to allow for the addition of further state variables.
        Parameters:
        request - HTTP servlet request
        projectId - project ID
        connectionId - connection ID
        Returns:
        mutable Map of state variable to state value
      • reportError

        protected org.springframework.web.servlet.ModelAndView reportError​(@NotNull
                                                                           String message)
      • reportError

        protected org.springframework.web.servlet.ModelAndView reportError​(@NotNull
                                                                           String message,
                                                                           @Nullable
                                                                           javax.servlet.http.HttpServletRequest request,
                                                                           @Nullable
                                                                           Throwable cause)
      • setUniqueRedirectService

        @Autowired(required=false)
        public void setUniqueRedirectService​(@NotNull
                                             UniqueRedirectService uniqueRedirectService)
      • setProjectManager

        @Autowired(required=false)
        public void setProjectManager​(@NotNull
                                      ProjectManager projectManager)