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

Fix cookie samesite issue for LTI 1.3 deep linking #2096

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def masked_authenticity_token(cookies, options = {})
encoded_masked_token = masked_token(unmasked_token(cookies["_csrf_token"]))

cookie = { value: encoded_masked_token }
%i[domain httponly secure].each do |key|
%i[domain httponly secure same_site].each do |key|
next unless options.key?(key)

cookie[key] = options[key]
Expand Down
3 changes: 2 additions & 1 deletion gems/request_context/lib/request_context/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def call(env)
ActionDispatch::Request.new(env).cookie_jar[:log_session_id] = {
value: session_id,
secure: Rails.application.config.session_options[:secure],
httponly: true
httponly: true,
same_site: Rails.application.config.session_options[:same_site]
}
end

Expand Down
2 changes: 1 addition & 1 deletion lib/canvas/request_forgery_protection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def verified_request?

def authenticity_token_options
session_options = CanvasRails::Application.config.session_options
options = session_options.slice(:domain, :secure)
options = session_options.slice(:domain, :secure, :same_site)
options[:httponly] = HostUrl.is_file_host?(request.host_with_port)
options
end
Expand Down