Add LTI 1.3 Dynamic Registration support#174
Open
pb-sobrien wants to merge 3 commits into
Open
Conversation
Implement the IMS LTI Dynamic Registration spec (lti-dr/v1p0) with four new classes under Packback\Lti1p3\DynamicRegistration: - OidcConfiguration: value object for platform OpenID Configuration - RegistrationPayload: builds the registration POST body per IMS spec - RegistrationResponse: value object for platform registration response - DynamicRegistrationService: Guzzle HTTP client for the two network calls Includes full test coverage (36 tests, 87 assertions) for happy paths and error cases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Omit the OAuth scope parameter when no scopes are requested (empty string is invalid per RFC 7591 and can cause strict platforms to reject registrations). Extract magic strings to class constants, replace array_filter with explicit conditionals, and DRY up test helper methods. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dbhynds
requested changes
May 20, 2026
Comment on lines
+9
to
+11
| private const LTI_TOOL_CONFIG_KEY = 'https://purl.imsglobal.org/spec/lti-tool-configuration'; | ||
| private const MESSAGE_TYPE_RESOURCE_LINK = 'LtiResourceLinkRequest'; | ||
| private const MESSAGE_TYPE_DEEP_LINKING = 'LtiDeepLinkingRequest'; |
Member
There was a problem hiding this comment.
This should all reference LtiConstants instead
| /** | ||
| * Build the registration POST body per the IMS spec. | ||
| */ | ||
| public function toArray(): array |
Member
There was a problem hiding this comment.
Use the Arrayable concern instead
|
|
||
| class RegistrationResponse | ||
| { | ||
| private const LTI_TOOL_CONFIG_KEY = 'https://purl.imsglobal.org/spec/lti-tool-configuration'; |
Move LTI tool configuration constant to LtiConstants, replace local message type constants with LtiConstants references, and adopt the Arrayable concern in RegistrationPayload. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dbhynds
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Packback\Lti1p3\DynamicRegistrationOidcConfiguration— value object for platform OpenID Configuration response withfromJson()/fromArray()factory methods and required field validationRegistrationPayload— builds the registration POST body per IMS spec, including LTI tool configuration, message types, custom parameters, and null filteringRegistrationResponse— value object for platform registration response, extractsclient_idanddeployment_idfrom nested LTI tool config keyDynamicRegistrationService— Guzzle-based HTTP client withfetchOpenIdConfiguration()andregister()methods, wrapping HTTP errors inLtiExceptionTest plan
composer lint-fix— passes (Pint)vendor/bin/phpstan analyse— 0 errorscomposer test— all tests pass🤖 Generated with Claude Code