📖 LTI 1.3

Learning Tools Interoperability v1.3

What is?

The IMS Learning Tools Interoperability® (LTI®) specification allows Learning Management Systems (LMS) or platforms to integrate remote tools and content in a standard way. LTI v1.3 builds on LTI v1.1 by incorporating a new model for security for message and service authentication. Learning Tools Interoperability Core Specification

HUB.Educational - Integration with the LTI 1.3 Standard

Integration with HUB.Educational allows users from different schools to access their partner educational tools from a centralized platform, with a single access - Single Sign On (SSO). The HUB.Educational achieves this functionality through the implementation of the LTI 1.3 Launching functionality (LTI 1.3 Launch). The tool must implement a secure POST endpoint by OAuth2 to receive initialization requests. When a system user requests an application to start, the HUB builds, and signs an LTI message, which is sent to the application's start endpoint. After the necessary validations, the tool should display the resources to the user.

This document will serve as a presentation of the integration pattern and an implementation guide.

For the writing of this document and implementation of the LTI 1.3 standard, the HUB.Educational team used the official Specification and Implementation Guide LTI 1.3 documentation made available by the IMS Global Learning Consortium.

In addition, the LTI Best Practices guide and also the LTI Basic Initialization: POST Parameters page can assist in the implementation process.

Contents

Integration of the Tool to the HUB.Educational

Application data

After confirming the registration of EdTech, the responsible person must register his tool in the HUB.Educational in an area reserved for approval. EdTech may add one or more tools. To have its tool integrated, EdTech must share some minimum basic information about the application. The minimum information is as follows:

  • Título: Title / Name of the tool displayed on the gallery card.
  • Descrição Curta: Short description of the tool displayed on the gallery card.
  • Logo: Image displayed on the gallery card.
  • Descrição Longa: Text presented in the detailing of the tool.
  • Site: URL for Edtech website or tool.

Portuguese Version

Além do registro da EdTech, a pessoa responsável também terá que fornecer as sequintes informações:

  • dsc_lti_version: Versão do LTI / '1.3'.

  • dsc_edtech_client_id: Id do cliente utilizado para o OAuth2.0.

  • dsc_edtech_client_secret: Secret do cliente utilizado para o OAuth2.0.

  • dsc_edtech_url_oauth2: URL do serviço de autenticação.

  • dsc_edtech_url_callback: URL de callback para login na Edtech.

  • Estas informações deverão ser registradas no Banco de Dados transacional na tabela: hub_aplicacao

Lambda - Chamada do Serviço

A lambda externalLti1p3LaunchTool (POST) será responsável por fazer a validação, autenticação e envio dos dados para Edtech a partir dos dados enviados pelo Header. Semelhante ao a versão do LTI 1.0, mas adicionando a camada de OAuth2 e inclusão dos demais atributos do LTI 1.3.

Utilizando o mesmo repositório da versão LTI 1.0. hub-lti.git, a nova versão adiciona ao projeto um novo service/external/lti1p3 que contém toda regra de negócio:

  1. Validação dos dados enviados pelo HEADER
  • header 'hub-app-id:' - Identificador da Aplicação no HUB
  • header 'hub-user-code:' - Código do usuário no HUB
  • header 'hub-institution-code:' Código da Instituição
  • header 'school-inep:': - Códifo INEP
  • header 'x-api-key:' - Chave de acesso a API
  1. Recupera os dados de configuração da Edtech na tbl hub_aplicacao
  2. Faz chamada para authenticação da 'edtech' via EP 'OAuth2'
  3. Recuperar o JwtToken da authenticação OAuth2
  4. Retorna os dados para o client fazer o POST para a URL de Callback da 'edtech'

Como Testar a Lambda - Localmente

OBS: A principio, esta implementação complenta apenas os atributos padrões do LTI 1.3. Sendo assim, poderá sofrer alterações com testes de Edtechs que utilizem outros atributos não validados nesta versão. Foi utilizada também uma Edtech mock para validar os dados.

Fazer o clone do projeto hub-lti.git
Baixar a branch: feature/lti-1p3
Rodar a aplicação com o serverless offline
Chamar o Endpoint da lambda no POSTMAN.

Para este teste foram utilizados os seguintes valores:

  • hub-app-id: 12 - "Aprendizagem de Matemática e Língua Portuguesa de uma maneira dinâmica, interativa e personalizada"
  • hub-user-code: 10102901 - "Aluno demo demo"
  • hub-institution-code: 447330 - "E. M. Antonio de Castro Figueiredo"
  • school-inep: 43000037

Exemplo: cURL:

curl --location --request POST 'http://localhost:3000/dev/v1/external/lti1p3/launch-tool' \
--header 'hub-app-id: 12' \
--header 'hub-user-code: 10102901' \
--header 'hub-institution-code: 447330' \
--header 'school-inep: 43000037' \
--header 'x-api-key: ******'

Response do serviço:

{
    "data": {
        "response": "true",
        "url": "https://9180f2e2-cb24-4ffe-a04d-8129fb5cc01b.mock.pstmn.io/tool",
        "method": "POST",
        "headers": {
            "Authorization": "eyJhbGciOiJIUzI1Ni*****",
            "content-type": "application/x-www-form-urlencoded"
        },
        "data": {
            "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOi******"
        }
    }
}

Onde:
"data.url": Endereço do endpoint da Edtech
"data.method": Nome do método
"data.headers": Authorization recuperado da chamada do OAuth2
"data.data.id_token": JWT com os dados do LT I1.3

OBS: para o geração do encode do id_token, foi utilizado o valor do dsc_edtech_client_secret

Neste exemplo o decode dos dados do id_token utilizado no modelo request do LTI 1.3 são:

{
  "iss": "http://login.dev.educacional.net/api/AuthHubAprimora",
  "sub": "",
  "aud": "4BDA0C2F-452A-11EB-BDBD-0A190BAE2C86",
  "exp": "1649650594",
  "iat": "1649646994",
  "azp": "",
  "nonce": "1649646994",
  "name": "Aluno demo demo",
  "given_name": "Aluno",
  "family_name": "d.",
  "middle_name": "d.",
  "picture": "",
  "email": "[email protected]",
  "locale": "pt-BR",
  "https://purl.imsglobal.org/spec/lti/claim/deployment_id": "4BDA0C2F-452A-11EB-BDBD-0A190BAE2C86",
  "https://purl.imsglobal.org/spec/lti/claim/message_type": "LtiResourceLinkRequest",
  "https://purl.imsglobal.org/spec/lti/claim/version": "1.3.0",
  "https://purl.imsglobal.org/spec/lti/claim/roles": [
    ""
  ],
  "https://purl.imsglobal.org/spec/lti/claim/role_scope_mentor": [
    ""
  ],
  "https://purl.imsglobal.org/spec/lti/claim/context": {
    "id": "",
    "label": "",
    "title": "",
    "type": [
      ""
    ]
  },
  "https://purl.imsglobal.org/spec/lti/claim/resource_link": {
    "id": "",
    "description": "",
    "title": ""
  },
  "https://purl.imsglobal.org/spec/lti/claim/tool_platform": {
    "guid": "",
    "contact_email": "",
    "description": "",
    "name": "",
    "url": "",
    "product_family_code": "",
    "version": ""
  },
  "https://purl.imsglobal.org/spec/lti/claim/target_link_uri": "",
  "https://purl.imsglobal.org/spec/lti/claim/launch_presentation": {
    "document_target": "",
    "height": 0,
    "width": 0,
    "return_url": ""
  },
  "https://purl.imsglobal.org/spec/lti/claim/custom": {
    "xstart": "",
    "request_url": ""
  },
  "https://purl.imsglobal.org/spec/lti/claim/lis": {
    "person_sourcedid": "",
    "course_offering_sourcedid": "",
    "course_section_sourcedid": ""
  },
  "http://www.ExamplePlatformVendor.com/session": {
    "id": ""
  }
}

Uma Edtech mock foi utilizada para validar os dados:

Lambda: service/external/mock-edtech/callback1

curl --location --request POST 'http://localhost:3000/dev/v1/external/mock-edtech-1/callback' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI****' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1N******'