Skip to content

Commit

Permalink
Merge pull request #178 from OpenDSA/lti13
Browse files Browse the repository at this point in the history
 Debug LTI 1.3 claims config issue
  • Loading branch information
babz007 authored Sep 11, 2024
2 parents bd1da89 + 4ebd10e commit def8fe5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/services/lti13_service/get_ags_access_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ def call
Rails.logger.info "Fetching client assertion from ClientCredentialsJwt"
client_assertion = Lti13Service::ClientCredentialsJwt.new(@lms_instance).call
Rails.logger.info "Client assertion (JWT) generated: #{client_assertion}"

# debug the LTI claims and scopes pulled from lti scopes & claims
Rails.logger.info "LTI claims and scopes configuration: #{Rails.configuration.lti_claims_and_scopes.inspect}"
Rails.logger.info "Line Item Scope: #{Rails.configuration.lti_claims_and_scopes['ags_scope_line_item']}"
Rails.logger.info "Result Scope: #{Rails.configuration.lti_claims_and_scopes['ags_scope_result']}"
Rails.logger.info "Score Scope: #{Rails.configuration.lti_claims_and_scopes['ags_scope_score']}"
Rails.logger.info "Names and Roles Scope: #{Rails.configuration.lti_claims_and_scopes['names_and_roles_scope']}"

# Build the request body for the token request
request_body = {
grant_type: 'client_credentials',
Expand All @@ -24,6 +32,9 @@ def call
client_assertion: client_assertion
}.to_query

# Log the complete request body
Rails.logger.info "Request body with scopes: #{request_body}"

# Establish a connection to the LMS's OAuth2 endpoint using Faraday
conn = Faraday.new(url: @lms_instance.oauth2_url) do |faraday|
faraday.headers['Content-Type'] = 'application/x-www-form-urlencoded'
Expand Down

0 comments on commit def8fe5

Please sign in to comment.