Comments (6)
I noticed the sameSite option in onConnect(), but it's too late. This is happening at the /login stage.
I'm not sure what externalRequest is meant to do when calling validUrl, but it's clearly not triggering for me, when it looks like it should.
I'll put some more debug tomorrow, and get back to you with more details about my exact use case.
from ltijs.
@esellin Hello, i used to set sameSite to 'None' everytime, but in new versions of chrome, cookies containing sameSite but without the secure flag are not allowed. So now i let the user decide this flag, and only set it automatically if the tool detects an external request.
You can set the flag in the onConnect method:
lti.onConnect((connection, request, response) => {
// Call redirect function
lti.redirect(response, '/main')
}, {sameSite: 'None'})
I should have drawn attention to that in the documentation update, my bad.
from ltijs.
@esellin I know it's confusing, but even the cookies at the login stage are managed by the options on onConnect, bad decision early in the project, moving them could potentially break peoples code so i havent done it yet, In future versions these configurations will be moved to the main constructor (I'll probably just keep the options at onConnect as depecrated options, to maintain retrocompatibility).
Can you try setting sameSite: 'None' in the onConnect method and tell me if it works?
(I also dont understand how the sameSite flag can cause errors in the login stage, the only cookies set are the state and iss validation cookies, and they shouldnt need the flag to work since theoretically they are not cross domain, anyway, thanks for reporting this issue, ill look into it, feel free to share more details of the current situation before adding the sameSite:None flag)
from ltijs.
It's working with sameSite: 'None' in the onConnect() options, thanks!
I think these cookies are cross-site cookies, because they're being sent to https://tool while the browser address bar is showing https://platform. Check out https://blog.chromium.org/2019/10/developers-get-ready-for-new.html
Thanks anyway!
from ltijs.
I'll consider how to move forward with this issue. I dont want to set sameSite automatically because in newer versions of chrome it requires the secure flag, which would make local testing without https impossible. But i also don't want to break login if sameSite is not present.
I'll run some tests and try to come up with a solution (maybe change how i validate the login parameters?). I'll keep this issue open while i work on this to avoid duplicates.
from ltijs.
This issue is now fixed in version 3.5. I'm using the database to store the validation information, it's more reliable and does not have the cors restriction that caused the problems.
I also moved the cookie configurations to the main constructor, but kept the old parameters in the onConnection method to avoid breaking older code.
from ltijs.
Related Issues (20)
- Error obtaining the roles
- /members and /grade endpoints are not working. They are throwing 500 error. HOT 5
- Update @types Repository or Migrate to TypeScript HOT 2
- Error on D2L LMS only
- Provide possibility to customize the bodyParser configuration
- /keys URL breaks if multiple LTIs are registered - error:1C800064:Provider routines::bad decrypt HOT 3
- Help Needed: "No Ltik or ID Token found." HOT 1
- unable to verify the first certificate issue HOT 1
- Unable to select content while Adding a External tool
- Getting this error when accessing the namesandroles and grades HTTPError: Internal Server Error HOT 2
- "MISSING_LOGIN_PARAMETERS" error : cookie issue?
- Provide opportunity to override `redirect_uri` in `Request.ltiAdvantageLogin`
- Feature Support: Submissions Review Service HOT 1
- Correct RS256 keypair keeps throwing: secretOrPrivateKey must be a symmetric key when using HS256
- Plans for the support of browsers disabling third-party cookies HOT 6
- Access the custom fields during launch HOT 1
- Potential concern of users viewing ltijs as an LTI "shim"
- Enhanced Database and Data Management Capabilities for Ltijs
- DeepLink error only in Moodle v 4.3 HOT 3
- How do i need to configure Moodle or LTIJS to retrieve the picture?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ltijs.