Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

12.1🔐 Google Authentication in QuizLab (Notebook / Web)

For instructors whose institution uses Google Workspace, it is possible, since version 1.0.0, to use Google authentication instead of the standard authentication enabled with needAuthentification=True. In that case, the parameter googleAuthentification=True must also be specified, in addition to the standard mandatoryInternet=True.

This short guide explains how to configure Google authentication and how to use it in QuizLab.

Note: The quiz file is specifically encrypted to enforce authentication when googleAuthentification=True is enabled. If students modify this parameter, they will not be able to decrypt the quiz file.


12.1.1Enable authentication in QuizLab

In your code, use something like

quiz = QuizLab(
    URL,
    QUIZFILE,
    needAuthentification=True,
    mandatoryInternet=True,
    googleAuthentification=True,
    retries=100,
    groups=['A', 'B', 'C']
)

if quiz.googleAuthentification:
    await quiz.googleAuthentify()

👉 The following parameters are mandatory for authentification:


12.1.2For instructors: Google Cloud configuration (once)

Go to: https://console.cloud.google.com/ (Create a project if needed)

In Google Cloud:


12.1.2.2b. Create OAuth credentials

Menu: APIs & Services → Credentials → Create Credentials → OAuth client ID


🖥️ Case 1 — Notebook / Local Python

If you intend your students to use a local desktop version of jupyter notebook or jupyter lab

client_desktop.json

🌐 Case 2 — Web application (e.g. JupyterLite)

client_web.json

12.1.3IT support (if required)

Contact your IT administrator if:


12.1.4✅ Result