app/models/launch.rb
##
# Returns the raw content of the lti launch
Returns the raw content of the lti launch
Returns the raw content of the lti launch
def payload 
    @payload ||= {
      'https://purl.imsglobal.org/spec/lti/claim/message_type': 'LtiResourceLinkRequest',
      'https://purl.imsglobal.org/spec/lti/claim/version': '1.3.0',
      'https://purl.imsglobal.org/spec/lti/claim/target_link_uri': @tool.target_link_uri,
      'https://purl.imsglobal.org/spec/lti/claim/deployment_id': @tool.id,
      'https://purl.imsglobal.org/spec/lti/claim/roles': [],
      'https://purl.imsglobal.org/spec/lti/claim/resource_link': {
        id: @tool.id
      },
      iss: Rails.application.secrets.issuer,
      aud: @tool.client_id,
      iat: Time.now.to_i,
      exp: 5.minutes.from_now.to_i,
      nonce: SecureRandom.hex(10)
    }.with_indifferent_access.merge(@context)
  end
def payload @payload ||= { 'https://purl.imsglobal.org/spec/lti/claim/message_type' : 'LtiResourceLinkRequest' , 'https://purl.imsglobal.org/spec/lti/claim/version' : '1.3.0' , 'https://purl.imsglobal.org/spec/lti/claim/target_link_uri' : @tool . target_link_uri , 'https://purl.imsglobal.org/spec/lti/claim/deployment_id' : @tool . id , 'https://purl.imsglobal.org/spec/lti/claim/roles' : [ ] , 'https://purl.imsglobal.org/spec/lti/claim/resource_link' : { id : @tool . id } , iss : Rails . application . secrets . issuer , aud : @tool . client_id , iat : Time . now . to_i , exp : 5 . minutes . from_now . to_i , nonce : SecureRandom . hex ( 10 ) } . with_indifferent_access . merge ( @context ) end
Returns the raw content of the lti launch
Returns the raw content of the lti launch
# rubocop:disable Metrics/MethodLength # String that indicates the type of the sender's LTI message # http://www.imsglobal.org/spec/lti/v1p3/#message-type-claim # String that indicates the version of LTI to which the message conforms. # http://www.imsglobal.org/spec/lti/v1p3/#lti-version-claim # Same value as the target_link_uri passed by the platform in the OIDC third party initiated login request. # http://www.imsglobal.org/spec/lti/v1p3/#target-link-uri # Case sensitive string that identifies the platform-tool integration governing the message. # http://www.imsglobal.org/spec/lti/v1p3/#lti-deployment-id-claim # Array of URI values for roles that the user has within the message's associated context. # By default it is empty but can be overwritten by providing a context. # http://www.imsglobal.org/spec/lti/v1p3/#roles-claim # Properties for the context from within which the resource link launch occurs. # By default it returns the launcher context. # http://www.imsglobal.org/spec/lti/v1p3/#context-claim # 'https://purl.imsglobal.org/spec/lti/claim/context': { #  id: @tool.id # }, # Properties for the resource link from which the launch message occurs. # By default it returns the launcher context. # http://www.imsglobal.org/spec/lti/v1p3/#resource-link-claim # Issuer Identifier for the Issuer of the message i.e. the Platform # https://tools.ietf.org/html/rfc7519#section-4.1.1 # Audience(s) for whom this ID Token is intended i.e. the Client. # It MUST contain the OAuth 2.0 client_id of the Client as an audience value. # https://tools.ietf.org/html/rfc7519#section-4.1.3 # Time at which the Issuer generated the JWT (epoch) # https://tools.ietf.org/html/rfc7519#section-4.1.6 # Expiration time on or after which the Client MUST NOT accept the ID Token for processing (epoch) # https://tools.ietf.org/html/rfc7519#section-4.1.4 # String value used to associate a Client session with an ID Token, and to mitigate replay attacks. # The nonce value is a case-sensitive string. # https://www.imsglobal.org/spec/security/v1p0#tool-jwt