Skip to content

Commit def8fe5

Browse files
authored
Merge pull request #178 from OpenDSA/lti13
Debug LTI 1.3 claims config issue
2 parents bd1da89 + 4ebd10e commit def8fe5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/services/lti13_service/get_ags_access_token.rb

+11
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ def call
1111
Rails.logger.info "Fetching client assertion from ClientCredentialsJwt"
1212
client_assertion = Lti13Service::ClientCredentialsJwt.new(@lms_instance).call
1313
Rails.logger.info "Client assertion (JWT) generated: #{client_assertion}"
14+
15+
# debug the LTI claims and scopes pulled from lti scopes & claims
16+
Rails.logger.info "LTI claims and scopes configuration: #{Rails.configuration.lti_claims_and_scopes.inspect}"
17+
Rails.logger.info "Line Item Scope: #{Rails.configuration.lti_claims_and_scopes['ags_scope_line_item']}"
18+
Rails.logger.info "Result Scope: #{Rails.configuration.lti_claims_and_scopes['ags_scope_result']}"
19+
Rails.logger.info "Score Scope: #{Rails.configuration.lti_claims_and_scopes['ags_scope_score']}"
20+
Rails.logger.info "Names and Roles Scope: #{Rails.configuration.lti_claims_and_scopes['names_and_roles_scope']}"
21+
1422
# Build the request body for the token request
1523
request_body = {
1624
grant_type: 'client_credentials',
@@ -24,6 +32,9 @@ def call
2432
client_assertion: client_assertion
2533
}.to_query
2634

35+
# Log the complete request body
36+
Rails.logger.info "Request body with scopes: #{request_body}"
37+
2738
# Establish a connection to the LMS's OAuth2 endpoint using Faraday
2839
conn = Faraday.new(url: @lms_instance.oauth2_url) do |faraday|
2940
faraday.headers['Content-Type'] = 'application/x-www-form-urlencoded'

0 commit comments

Comments
 (0)