Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure correct LTI version of lti_user_id is used on launch #7335

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Fixed bug in grading context menu for editing/deleting annotations (#7309)
- Fixed bug in grading annotations table when deleting annotations (#7309)
- Ensures row selection for peer reviewer unassigning has the same validation checks as individual selections (#7274)
- Ensure correct LTI version of lti_user_id is used on launch (#7335)

### 🔧 Internal changes

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/lti_deployments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def redirect_login
lti_data[:line_items] = grades_endpoints['lineitems']
end
end
lti_data[:lti_user_id] = lti_params[LtiDeployment::LTI_CLAIMS[:user_launch_data]]['user_id']
lti_data[:lti_user_id] = lti_params[LtiDeployment::LTI_CLAIMS[:user_id]]
unless logged_in?
lti_data[:lti_redirect] = request.url
cookies.encrypted.permanent[:lti_data] =
Expand Down
2 changes: 1 addition & 1 deletion app/models/lti_deployment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LtiDeployment < ApplicationRecord
names_role: 'https://purl.imsglobal.org/spec/lti-nrps/claim/namesroleservice',
ags_lineitem: 'https://purl.imsglobal.org/spec/lti-ags/claim/endpoint',
deployment_id: 'https://purl.imsglobal.org/spec/lti/claim/deployment_id',
user_launch_data: 'https://purl.imsglobal.org/spec/lti/claim/lti1p1' }.freeze
user_id: 'sub' }.freeze
LTI_ROLES = { learner: 'http://purl.imsglobal.org/vocab/lis/v2/membership#Learner',
test_user: 'http://purl.imsglobal.org/vocab/lti/system/person#TestUser',
ta: 'http://purl.imsglobal.org/vocab/lis/v2/membership/Instructor#TeachingAssistant',
Expand Down
4 changes: 1 addition & 3 deletions spec/support/lti_controller_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@
course_id: 1,
user_id: 1
},
LtiDeployment::LTI_CLAIMS[:user_launch_data] => {
user_id: 'lti_user_id'
} }
LtiDeployment::LTI_CLAIMS[:user_id] => 'some_user_id' }
end
let(:pub_jwk) { JWT::JWK.new(OpenSSL::PKey::RSA.new(1024)) }
let(:lti_jwt) { JWT.encode(payload, pub_jwk.keypair, 'RS256', { kid: pub_jwk.kid }) }
Expand Down