Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-72188

Add Javascript API in Safe Exam Browser (SEB) integration to query the keys (BEK/CK)



    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Component/s: Quiz
    • Affected Branches:


      This tracker created based on Daniel R. Schneider message in in a Telegram channel.

      In new macOS and iOS versions of SEB. There are/will support the modern WebKit browser engine (the WKWebView API), which has many advantages. It increases performance, stability and compatibility with web applications. Very important: Is supports access to camera/microphone via WebRTC (getUserMedia etc.). Unfortunately Apple decided to not allow to add custom headers to HTTP request. Therefore we need another way how to transmit the ConfigKey and BrowserExamKey hashes to the assessment web application.

      From version 3.0 for IOS SEB supports JavaScript API which allows to query app version details, and the ConfigKey and BrowserExamKey security elements. It is inspired by the Smarter Balanced Assessment Consortium Secure Browser API Specification (https://github.com/SmarterApp/SB_BIRT/blob/master/irp/doc/req/SecureBrowserAPIspecification.md )

      Currently the current request header transmission of the CK/BEK is still supported, if sending the CK/BEK is enabled, then the classic WebView is used. But to profit from the benefits of the modern WKWebView in the main browser tab where Moodle is displayed, it would be necessary to support the new SEB JS API for querying the CK/BEK as well.

      There are some discussions


      Thoughts about the steps to support the SEB JS API in Moodle (on an abstract level):

      1. Support both the HTTP header check and the JavaScript API for the ConfigKey (and if required for the BrowserExamKey BEK). As mentioned, the keys will be same for the same web page (URL). So the web application can check for the availability of the SafeExamBrowser.security.updateKeys() function (or the SafeExamBrowser.version variable). If it‘s available, then the JavaScript API is supported and you can get the ConfigKey/BEK from it. Otherwise get the ConfigKey/BEK from the HTTP headers.
      2. In the SEB configuration generated by Moodle, set the SEB settings key browserWindowWebView to the policy "Prefer Modern" (integer value 3), which will force the use of the modern WebView and the Javascript API in SEB versions where it is available. 


          Issue Links



              Unassigned Unassigned
              dmitriim Dmitrii Metelkin
              Component watchers:
              Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              1 Vote for this issue
              4 Start watching this issue