NP.Lti13Platform.NameRoleProvisioningServices 1.0.0-preview001

This is a prerelease version of NP.Lti13Platform.NameRoleProvisioningServices.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package NP.Lti13Platform.NameRoleProvisioningServices --version 1.0.0-preview001                
NuGet\Install-Package NP.Lti13Platform.NameRoleProvisioningServices -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.NameRoleProvisioningServices" 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.NameRoleProvisioningServices --version 1.0.0-preview001                
#r "nuget: NP.Lti13Platform.NameRoleProvisioningServices, 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.NameRoleProvisioningServices as a Cake Addin
#addin nuget:?package=NP.Lti13Platform.NameRoleProvisioningServices&version=1.0.0-preview001&prerelease

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

NP.Lti13Platform.NameRoleProvisioningServices

The IMS Name and Role Provisioning Services spec defines a way that tools can request the names and roles of members of a context. This project provides an implementation of the spec.

Features

  • Returns the members of a context

Getting Started

  1. Add the nuget package to your project:

  2. Add an implementation of the INameRoleProvisioningDataService interface:

public class DataService: INameRoleProvisioningDataService
{
    ...
}
  1. Add the required services.
builder.Services
    .AddLti13PlatformCore()
    .AddLti13PlatformNameRoleProvisioningServices()
    .AddDefaultNameRoleProvisioningService();

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

INameRoleProvisioningDataService

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

The INameRoleProvisioningDataService interface is used to get the persisted members of a context filtered by multiple parameters.

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 UseLti13PlatformNameRoleProvisioningServices().

app.UseLti13PlatformNameRoleProvisioningServices(config => {
    config.NamesAndRoleProvisioningServicesUrl = "/lti13/{deploymentId}/{contextId}/memberships"; // {deploymentId} and {contextId} are required
});

INameRoleProvisioningService

The INameRoleProvisioningService interface is used to get the config for the name and role provisioning service. The config is used to tell the tools how to request the members of a context.

There is a default implementation of the INameRoleProvisioningService interface that uses a configuration set up on app start. When calling the AddDefaultNameRoleProvisioningService method, the configuration can be setup at that time. A fallback to the current request scheme and host will be used if no ServiceEndpoint is configured. The Default implementation can be overridden by adding a new implementation of the INameRoleProvisioningService interface and not including the Default. This may be useful if the service URL is dynamic or needs to be determined at runtime.

builder.Services
    .AddLti13PlatformCore()
    .AddLti13PlatformNameRoleProvisioningServices()
    .AddDefaultNameRoleProvisioningService(x => { x.ServiceAddress = new Uri("https://<mysite>") });

Member Message

The IMS Name and Role Provisioning Services spec defines a way to give tools access to the parts of LTI messages that are specific to members. This project includes the specifics for the core message and known properties defined within the spec. Additional message can be added by calling ExtendNameRoleProvisioningMessage on startup. This follows the same pattern as Populators from the core spec. These messages should only contain the user specific message properties of the given message. Multiple populators may be added for the same interface and multiple interfaces may be added for the same <message_type>.

builder.Services
    .AddLti13PlatformCore()
    .AddLti13PlatformNameRoleProvisioningServices()
    .AddDefaultNameRoleProvisioningService()
    .ExtendNameRoleProvisioningMessage<IMessage, MessagePopulator>("<message_type>");
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.NameRoleProvisioningServices:

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 41 11/2/2024
1.0.0-preview002 42 10/26/2024
1.0.0-preview001 38 10/26/2024
0.1.0-preview002 40 10/23/2024
0.1.0-beta 35 10/23/2024