Class OauthController


  • @Controller
    public class OauthController
    extends Object
    Controller for obtaining an oauth token for a user. It redirects the user to the Canvas oauth endpoint which requests the user's permission. Once they grant permission, a request comes back here with a "code" which is then used to make another request from the server to Canvas to verify things and finally get the actual token back.
    • Method Detail

      • getApplicationBaseUrl

        public static String getApplicationBaseUrl​(javax.servlet.http.HttpServletRequest request,
                                                   boolean includeLtiApp)
        Returns the base URL of this application. This includes scheme, hostname and port number. Useful for when you need an absolute URL pointing to something in this application but don't want to hard-code so it still works in alpha, beta and production. Does NOT include a trailing slash.
        Parameters:
        request - servlet request
        includeLtiApp - Specify whether to include the application context part of the URL (/bioDemo, /learnItLive, etc)
        Returns:
        Base URL of this application