Skip to content
Snippets Groups Projects
Commit 50c59c17 authored by Ghazi Triki's avatar Ghazi Triki
Browse files

Make LTI URLs work.

parent 6751a25b
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,8 @@
bigbluebuttonURL=http://localhost/bigbluebutton
# Salt which is used by 3rd-party apps to authenticate api calls
bigbluebuttonSalt=bbb_salt
# The application name to use in URL path /lti
appName=lti
# LTI basic information
#----------------------------------------------------
......@@ -68,3 +70,5 @@ beans.ltiService.restrictedAccess=${ltiRestrictedAccess}
beans.ltiService.recordedByDefault=${ltiAllRecordedByDefault}
beans.ltiService.canvasPlacements=${ltiCanvasPlacements}
beans.ltiService.canvasPlacementName=${ltiCanvasPlacementName}
beans.toolService.appName=${appName}
\ No newline at end of file
......@@ -21,13 +21,13 @@ package org.bigbluebutton.lti
class UrlMappings {
static mappings = {
"/$controller/$action?/$id?(.$format)?" {
"/lti/$controller/$action?/$id?(.$format)?" {
constraints {
// apply constraints here
}
}
"/"(controller: "tool")
"/lti/"(controller: "tool")
"500"(view: '/error')
}
}
......@@ -27,9 +27,11 @@ import java.text.DateFormat
*/
import java.text.SimpleDateFormat
import java.util.*
class ToolController {
def appName = "lti"
private static final String CONTROLLER_NAME = 'ToolController'
private static final String RESP_CODE_SUCCESS = 'SUCCESS'
private static final String RESP_CODE_FAILED = 'FAILED'
......@@ -59,7 +61,7 @@ class ToolController {
// On post request proceed with the launch.
def schemeHeader = request.getHeader("X-Forwarded-Proto")
def scheme = schemeHeader == null ? ltiService.getScheme(request) : schemeHeader
def endPoint = scheme + "://" + ltiService.endPoint + "/" + grailsApplication.metadata['app.name'] + "/" + params.get("controller") + (params.get("format") != null ? "." + params.get("format") : "")
def endPoint = scheme + "://" + ltiService.endPoint + "/" + appName + "/" + params.get("controller") + (params.get("format") != null ? "." + params.get("format") : "")
log.info "endPoint: " + endPoint
ArrayList<String> missingParams = new ArrayList<String>()
......@@ -362,7 +364,7 @@ class ToolController {
}
private String getCartridgeXML(){
def lti_endpoint = ltiService.retrieveBasicLtiEndpoint() + '/' + grailsApplication.metadata['app.name']
def lti_endpoint = ltiService.retrieveBasicLtiEndpoint() + '/' + appName
def launch_url = 'http://' + lti_endpoint + '/tool'
def secure_launch_url = 'https://' + lti_endpoint + '/tool'
def icon = 'http://' + lti_endpoint + '/assets/icon.ico'
......
......@@ -21,3 +21,28 @@
include fastcgi_params;
}
location /lti/assets/ {
proxy_pass http://127.0.0.1:8181/assets/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Workaround IE refusal to set cookies in iframe
add_header P3P 'CP="No P3P policy available"';
# Allow 30M uploaded presentation document.
client_max_body_size 30m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
include fastcgi_params;
proxy_request_buffering off;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment