jupyterhub / ltiauthenticator

A JupyterHub authenticator for LTI

Home Page:https://ltiauthenticator.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat(lti13) Allow `username_key` to be located inside the `custom` claim

martinclaus opened this issue · comments

Proposed change

Allow username_key to be optionally located in the https://purl.imsglobal.org/spec/lti/claim/custom claim, as suggested by the config help. This would improve interoperability since some LMS provide their username only as a custom claim.

Alternative options

Subclassing by user to add required logic which increases their maintenance burden.

Who would use this feature?

User that deal with an LMS Platform that does not provide a proper username via top-level claims (e.g. email, username) but within the "custom" claim, e.g via custom parameter substitution.

Suggested solution

If the value of username_key traitlet begins with custom_, this part will be removed and the remainder is looked up within the https://purl.imsglobal.org/spec/lti/claim/custom claim. This should be sufficiently save with respect to name collisions, since LTI 1.3 does not define top-level claims that begin with custom_. It is also the default naming scheme for custom claims in LTI 1.1.

Fixed in #142