Skip to content
Snippets Groups Projects
Commit 21d874b9 authored by Jacob Laboissonniere's avatar Jacob Laboissonniere Committed by Jesus Federico
Browse files

In the bbb-lti applicaation, add a way to configure the parameters used for...

In the bbb-lti applicaation, add a way to configure the parameters used for generating the meetingID (#6714)

* Can now configure parameters used to generate meeting_id

* Add back deleted config stuff

* Fix documentation typo

* Fix bad indentation

* Change function name
parent c866933a
No related branches found
No related tags found
No related merge requests found
......@@ -49,11 +49,16 @@ ltiAllRecordedByDefault=false
ltiCanvasPlacements=
ltiCanvasPlacementName=BigBlueButton
# Parameters to generate a unique meeting ID from
# By default, resource_link_id and oauth_consumer_key are used, but certain LMS don't provide unique resource_link_ids
# Specify parameters separated by commas. Can leave blank to use default.
meetingIdParams=resource_link_id,oauth_consumer_key
#----------------------------------------------------
# Inject configuration values into BigbluebuttonSrvice beans
beans.bigbluebuttonService.url=${bigbluebuttonURL}
beans.bigbluebuttonService.salt=${bigbluebuttonSalt}
beans.bigbluebuttonService.idParams=${meetingIdParams}
#----------------------------------------------------
# Inject configuration values into LtiSrvice beans
beans.ltiService.endPoint=${ltiEndPoint}
......
......@@ -56,7 +56,8 @@ class BigbluebuttonService {
def url = "http://test-install.blindsidenetworks.com/bigbluebutton"
def salt = "8cd8ef52e8e101574e400365b55e11a6"
def idParams = "resource_link_id,oauth_consumer_key"
Proxy bbbProxy
DocumentBuilderFactory docBuilderFactory
DocumentBuilder docBuilder
......@@ -81,8 +82,9 @@ class BigbluebuttonService {
if (!salt.equals(bbbProxy.salt) && !salt.equals("")) {
bbbProxy.setSalt(salt)
}
String meetingName = getValidatedMeetingName(params.get(Parameter.RESOURCE_LINK_TITLE))
String meetingID = getValidatedMeetingId(params.get(Parameter.RESOURCE_LINK_ID), params.get(Parameter.CONSUMER_ID))
String meetingID = getValidatedMeetingId(getParamsForMeetingId(params))
String attendeePW = DigestUtils.shaHex("ap" + params.get(Parameter.RESOURCE_LINK_ID) + params.get(Parameter.CONSUMER_ID))
String moderatorPW = DigestUtils.shaHex("mp" + params.get(Parameter.RESOURCE_LINK_ID) + params.get(Parameter.CONSUMER_ID))
String logoutURL = getValidatedLogoutURL(params.get(Parameter.LAUNCH_RETURN_URL))
......@@ -133,7 +135,7 @@ class BigbluebuttonService {
if (!salt.equals(bbbProxy.salt) && !salt.equals("")) {
bbbProxy.setSalt(salt)
}
String meetingID = getValidatedMeetingId(params.get(Parameter.RESOURCE_LINK_ID), params.get(Parameter.CONSUMER_ID))
String meetingID = getValidatedMeetingId(getParamsForMeetingId(params))
String recordingsURL = bbbProxy.getGetRecordingsURL(meetingID)
Map<String, Object> responseAPICall = doAPICall(recordingsURL)
if (responseAPICall == null) {
......@@ -204,8 +206,8 @@ class BigbluebuttonService {
return (meetingName == null || meetingName == "")? "Meeting": meetingName
}
private String getValidatedMeetingId(String resourceId, String consumerId){
return DigestUtils.shaHex(resourceId + consumerId)
private String getValidatedMeetingId(String params){
return DigestUtils.shaHex(params)
}
private String getValidatedLogoutURL(String logoutURL){
......@@ -370,4 +372,23 @@ class BigbluebuttonService {
}
return list;
}
/**
* Get the value of all params from idParams (specified in lti-config)
* If none are specified, fallback to using resource_link_id and oauth_consumer_key
*/
private String getParamsForMeetingId(params) {
String[] paramArray = idParams.split(",");
String result = "";
for(String s : paramArray) {
if(params.get(s) != null) {
result += params.get(s);
}
}
// If we can't get anything from config, fallback to old way
if(result.equals("")) {
result = params.get(Parameter.RESOURCE_LINK_ID) + params.get(Parameter.CONSUMER_ID);
}
return result;
}
}
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