CI Hex.pm Hex Docs License

Ltix is an Elixir library for building LTI 1.3 tool applications. It handles the OIDC launch flow, JWT verification, and claim parsing so you can focus on what your tool actually does.

# Platform initiates login - build the redirect
{:ok, %{redirect_uri: url, state: state}} =
  Ltix.handle_login(params, launch_url)

# Platform sends the signed JWT - validate and parse
{:ok, context} = Ltix.handle_callback(params, state)

context.claims.roles          #=> [%Role{type: :context, name: :instructor}, ...]
context.claims.resource_link  #=> %ResourceLink{id: "link-1", title: "Assignment 1"}
context.registration          #=> your struct from StorageAdapter.get_registration/2

Features

  • Two-function launch API - handle_login/3 and handle_callback/3 cover the entire OIDC flow
  • LTI Advantage - Assignment and Grade Services, Names and Role Provisioning, and Deep Linking
  • Storage-agnostic - implement four callbacks in Ltix.StorageAdapter to plug in any persistence layer
  • Framework-agnostic - works with Phoenix, bare Plug, or any Elixir web framework
  • Structured claims - roles, context, resource links, and service endpoints parsed into typed structs
  • Spec-referenced errors - classified as :invalid, :security, or :unknown, with a spec_ref pointing to the relevant spec section
  • Testing utilities - Ltix.Test provides a simulated platform for integration tests without a real LMS

Installation

Add :ltix to your dependencies:

def deps do
  [
    {:ltix, "~> 0.1"}
  ]
end

Documentation

License

MIT.

See LICENSE for details.