NP.Lti13Platform.DeepLinking 1.0.0-preview001

This is a prerelease version of NP.Lti13Platform.DeepLinking.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package NP.Lti13Platform.DeepLinking --version 1.0.0-preview001                
NuGet\Install-Package NP.Lti13Platform.DeepLinking -Version 1.0.0-preview001                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NP.Lti13Platform.DeepLinking" Version="1.0.0-preview001" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NP.Lti13Platform.DeepLinking --version 1.0.0-preview001                
#r "nuget: NP.Lti13Platform.DeepLinking, 1.0.0-preview001"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NP.Lti13Platform.DeepLinking as a Cake Addin
#addin nuget:?package=NP.Lti13Platform.DeepLinking&version=1.0.0-preview001&prerelease

// Install NP.Lti13Platform.DeepLinking as a Cake Tool
#tool nuget:?package=NP.Lti13Platform.DeepLinking&version=1.0.0-preview001&prerelease                

NP.Lti13Platform.DeepLinking

The IMS Deep Linking spec defines a way that platforms can get content from tools. This project provides an implementation of the spec.

Features

  • Launch the deep linking flow
  • Receive the deep linking responses

Getting Started

  1. Add the nuget package to your project:

  2. Add an implementation of the IDeepLinkingDataService interface:

public class DataService: IDeepLinkingDataService
{
    ...
}
  1. Add the required services.
builder.Services
    .AddLti13PlatformCore()
    .AddLti13PlatformDeepLinking()
    .AddDefaultDeepLinkingService();

builder.Services.AddTransient<IDeepLinkingDataService, DataService>();
  1. Setup the routing for the LTI 1.3 platform endpoints:
app.UseLti13PlatformDeepLinking();

IDeepLinkingDataService

There is no default IDeepLinkingDataService implementation to allow each project to store the data how they see fit.

The IDeepLinkingDataService interface is used to manage the persistance of resource links and other content items.

All of the internal services are transient and therefore the data service may be added at any scope (Transient, Scoped, Singleton).

Defaults

Routing

Default routes are provided for all endpoints. Routes can be configured when calling UseLti13PlatformDeepLinking().

app.UseLti13PlatformDeepLinking(config => {
    config.DeepLinkingResponseUrl = "/lti13/deeplinking/{contextId?}"; // {contextId?} is required
});

IDepLinkingService

The IDepLinkingService interface is used to get the config for the deep linking service as well as handle the response from the tool. The config is used to control how deep link requests are made and how the response will be handled.

There is a default implementation of the IDepLinkingService interface that uses a configuration set up on app start. When calling the AddDefaultDeepLinkingService method, the configuration can be setup at that time. A fallback to the current request scheme and host will be used if no ServiceAddress is configured. The Default implementation can be overridden by adding a new implementation of the IDepLinkingService interface and not including the Default.

builder.Services
    .AddLti13PlatformCore()
    .AddLti13PlatformDeepLinking()
    .AddDefaultDeepLinkingService(x => { /* Update config as needed */ });

Recommended:

Then default handling of the response is to return it as an 200 OK response with the response body being a JSON representation of the content items returned from the tool. It is strongly recommended to use the Default for development only.

Configuration

The configuration for the Deep Linking service tells the tools what kinds of things the platform is looking for and how it will handle the items when they are returned.

<hr>

AcceptPresentationDocumentTargets Default: ["embed", "iframe", "window"]{:csharp}

Defines how the content items will be shown to users (Embedded, Iframe, Window).

<hr>

AcceptTypes Default: ["file", "html", "image", "link", "ltiResourceLink"]{:csharp}

Defines which types of content items the platform is looking for (File, Html, Image, Link, ResourceLink).

<hr>

AcceptMediaTypes Default: ["image/*", "text/html"]{:csharp}

Defines which media types the platform is looking for (image/*, text/html).

<hr>

AcceptLineItem Default: true{:csharp}

Whether the platform in the context of that deep linking request supports or ignores line items included in LTI Resource Link items. False indicates line items will be ignored. True indicates the platform will create a line item when creating the resource link. If the field is not present, no assumption that can be made about the support of line items.

<hr>

AcceptMultiple Default: true{:csharp}

Whether the platform allows multiple content items to be submitted in a single response.

<hr>

AutoCreate Default: true{:csharp}

Whether any content items returned by the tool would be automatically persisted without any option for the user to cancel the operation.

<hr>

ServiceAddress Default: null{:csharp}

The web address where the deep linking responses will be handled. If not set, the current request scheme and host will be used.

<hr>

ContentItemTypes Default: []{:csharp}

A dictionary of type configurations to be used when deserialzing the content items. If not set, the content items will be deserialized as Dictionary<string, JsonElement>{:csharp} objects. A convenience method to add the known content items to this dictionary is provided.

builder.Services
    .AddLti13PlatformCore()
    .AddLti13PlatformDeepLinking()
    .AddDefaultDeepLinkingService(x => 
    {
        x.AddDefaultContentItemMapping();
    });
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NP.Lti13Platform.DeepLinking:

Package Downloads
NP.Lti13Platform

A platform implementation of the LTI 1.3 spec. Includes the Core, DeepLinking, Assignment and Grade Services, and Name and Role Provisioning Services specs.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-preview003 45 11/2/2024
1.0.0-preview002 47 10/26/2024
1.0.0-preview001 38 10/26/2024
0.1.0-preview002 40 10/23/2024
0.1.0-preview001 39 10/23/2024
0.1.0-beta 36 10/23/2024