Skip to content
Snippets Groups Projects
Commit c1ffd82c authored by jfederico's avatar jfederico
Browse files

bbb-lti: Fix for issue #3595

parent 79622284
No related branches found
No related tags found
No related merge requests found
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
# BigBlueButton integration information # BigBlueButton integration information
#---------------------------------------------------- #----------------------------------------------------
# This URL is where the BBB client is accessible. # This URL is where the BBB client is accessible.
bigbluebuttonURL=http://localhost/bigbluebutton bigbluebuttonURL=http://localhost/bigbluebutton
# Salt which is used by 3rd-party apps to authenticate api calls # Salt which is used by 3rd-party apps to authenticate api calls
bigbluebuttonSalt=bbb_salt bigbluebuttonSalt=bbb_salt
# LTI basic information # LTI basic information
#---------------------------------------------------- #----------------------------------------------------
# This URL is where the LTI plugin is accessible. It can be a different server than the BigBluebutton one # This URL is where the LTI plugin is accessible. It can be a different server than the BigBluebutton one
# Only the hostname or IP address is required, plus the port number in case it is other than port 80 # Only the hostname or IP address is required, plus the port number in case it is other than port 80
# e.g. localhost or localhost:port # e.g. localhost or localhost:port
ltiEndPoint=localhost ltiEndPoint=localhost
...@@ -41,6 +41,9 @@ ltiMode=extended ...@@ -41,6 +41,9 @@ ltiMode=extended
# Defines if LTI credentials are required # Defines if LTI credentials are required
# Format: [false|<true>] # Format: [false|<true>]
ltiRestrictedAccess=true ltiRestrictedAccess=true
# Sets all the meetings to be recorded by default
# Format: [<false>|true]
ltiAllRecordedByDefault=false
#---------------------------------------------------- #----------------------------------------------------
# Inject configuration values into BigbluebuttonSrvice beans # Inject configuration values into BigbluebuttonSrvice beans
...@@ -53,4 +56,4 @@ beans.ltiService.endPoint=${ltiEndPoint} ...@@ -53,4 +56,4 @@ beans.ltiService.endPoint=${ltiEndPoint}
beans.ltiService.consumers=${ltiConsumers} beans.ltiService.consumers=${ltiConsumers}
beans.ltiService.mode=${ltiMode} beans.ltiService.mode=${ltiMode}
beans.ltiService.restrictedAccess=${ltiRestrictedAccess} beans.ltiService.restrictedAccess=${ltiRestrictedAccess}
beans.ltiService.recordedByDefault=${ltiAllRecordedByDefault}
package org.bigbluebutton package org.bigbluebutton
/* /*
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
...@@ -83,8 +83,8 @@ class ToolController { ...@@ -83,8 +83,8 @@ class ToolController {
result = doJoinMeeting(params) result = doJoinMeeting(params)
} else { } else {
log.debug "LTI service running in extended mode." log.debug "LTI service running in extended mode."
if ( !Boolean.parseBoolean(params.get(Parameter.CUSTOM_RECORD)) ) { if ( !Boolean.parseBoolean(params.get(Parameter.CUSTOM_RECORD)) && !ltiService.allRecordedByDefault() ) {
log.debug "No bbb_record parameter was sent; immediately redirecting to BBB session!" log.debug "Parameter custom_record was not sent; immediately redirecting to BBB session!"
result = doJoinMeeting(params) result = doJoinMeeting(params)
} }
} }
...@@ -222,7 +222,7 @@ class ToolController { ...@@ -222,7 +222,7 @@ class ToolController {
log.debug "Overriding default welcome message with: [" + welcome + "]" log.debug "Overriding default welcome message with: [" + welcome + "]"
} }
if ( params.containsKey(Parameter.CUSTOM_RECORD) && Boolean.parseBoolean(params.get(Parameter.CUSTOM_RECORD)) ) { if ( params.containsKey(Parameter.CUSTOM_RECORD) && Boolean.parseBoolean(params.get(Parameter.CUSTOM_RECORD)) || ltiService.allRecordedByDefault() ) {
welcome += "<br><b>" + message(code: "bigbluebutton.welcome.record") + "</b><br>" welcome += "<br><b>" + message(code: "bigbluebutton.welcome.record") + "</b><br>"
log.debug "Adding record warning to welcome message, welcome is now: [" + welcome + "]" log.debug "Adding record warning to welcome message, welcome is now: [" + welcome + "]"
} }
......
package org.bigbluebutton package org.bigbluebutton
/* /*
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
...@@ -92,7 +92,7 @@ class BigbluebuttonService { ...@@ -92,7 +92,7 @@ class BigbluebuttonService {
Integer duration = 0 Integer duration = 0
if( "extended".equals(mode) ){ if( "extended".equals(mode) ){
voiceBridge = getValidatedBBBVoiceBridge(params.get(Parameter.CUSTOM_VOICEBRIDGE)) voiceBridge = getValidatedBBBVoiceBridge(params.get(Parameter.CUSTOM_VOICEBRIDGE))
record = getValidatedBBBRecord(params.get(Parameter.CUSTOM_RECORD)) record = getValidatedBBBRecord(params.get(Parameter.CUSTOM_RECORD)) || ltiService.allRecordedByDefault()
duration = getValidatedBBBDuration(params.get(Parameter.CUSTOM_DURATION)) duration = getValidatedBBBDuration(params.get(Parameter.CUSTOM_DURATION))
} }
...@@ -240,7 +240,7 @@ class BigbluebuttonService { ...@@ -240,7 +240,7 @@ class BigbluebuttonService {
private String getValidatedUserId(String userId){ private String getValidatedUserId(String userId){
return (userId == null)? "": userId return (userId == null)? "": userId
} }
private Integer getValidatedBBBVoiceBridge(String voiceBridge){ private Integer getValidatedBBBVoiceBridge(String voiceBridge){
return (voiceBridge != null )? voiceBridge.toInteger(): 0 return (voiceBridge != null )? voiceBridge.toInteger(): 0
} }
......
package org.bigbluebutton package org.bigbluebutton
/* /*
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below). Copyright (c) 2012 BigBlueButton Inc. and by respective authors (see below).
...@@ -32,9 +32,10 @@ class LtiService { ...@@ -32,9 +32,10 @@ class LtiService {
def consumers = "demo:welcome" def consumers = "demo:welcome"
def mode = "simple" def mode = "simple"
def restrictedAccess = "true" def restrictedAccess = "true"
def recordedByDefault = "false"
Map<String, String> consumerMap Map<String, String> consumerMap
def retrieveIconEndpoint() { def retrieveIconEndpoint() {
return endPoint.replaceFirst("tool", "images/icon.ico") return endPoint.replaceFirst("tool", "images/icon.ico")
} }
...@@ -42,16 +43,16 @@ class LtiService { ...@@ -42,16 +43,16 @@ class LtiService {
def retrieveBasicLtiEndpoint() { def retrieveBasicLtiEndpoint() {
return endPoint return endPoint
} }
private Map<String, String> getConsumer(consumerId) { private Map<String, String> getConsumer(consumerId) {
Map<String, String> consumer = null Map<String, String> consumer = null
if( this.consumerMap.containsKey(consumerId) ){ if( this.consumerMap.containsKey(consumerId) ){
consumer = new HashMap<String, String>() consumer = new HashMap<String, String>()
consumer.put("key", consumerId); consumer.put("key", consumerId);
consumer.put("secret", this.consumerMap.get(consumerId)) consumer.put("secret", this.consumerMap.get(consumerId))
} }
return consumer return consumer
} }
...@@ -66,19 +67,19 @@ class LtiService { ...@@ -66,19 +67,19 @@ class LtiService {
this.consumerMap.put(consumer[0], consumer[1]) this.consumerMap.put(consumer[0], consumer[1])
} }
} }
} }
public String sign(String sharedSecret, String data) throws Exception public String sign(String sharedSecret, String data) throws Exception
{ {
Mac mac = setKey(sharedSecret) Mac mac = setKey(sharedSecret)
// Signed String must be BASE64 encoded. // Signed String must be BASE64 encoded.
byte[] signBytes = mac.doFinal(data.getBytes("UTF8")); byte[] signBytes = mac.doFinal(data.getBytes("UTF8"));
String signature = encodeBase64(signBytes); String signature = encodeBase64(signBytes);
return signature; return signature;
} }
private Mac setKey(String sharedSecret) throws Exception private Mac setKey(String sharedSecret) throws Exception
{ {
Mac mac = Mac.getInstance("HmacSHA1"); Mac mac = Mac.getInstance("HmacSHA1");
...@@ -137,10 +138,14 @@ class LtiService { ...@@ -137,10 +138,14 @@ class LtiService {
log.debug("Exception: Message=" + e.getMessage()) log.debug("Exception: Message=" + e.getMessage())
} }
return ssl_enabled return ssl_enabled
} }
def boolean hasRestrictedAccess() { def boolean hasRestrictedAccess() {
return Boolean.parseBoolean(this.restrictedAccess); return Boolean.parseBoolean(this.restrictedAccess);
} }
def boolean allRecordedByDefault() {
return Boolean.parseBoolean(this.recordedByDefault);
}
} }
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