celtic-project / LTI-PHP

PHP class library for building LTI integrations
GNU Lesser General Public License v3.0
48 stars 38 forks source link

Databaseless? #2

Closed cesbrandt closed 4 years ago

cesbrandt commented 4 years ago

Sorry for the "rambling," I tried to give context to the question.

We've been using this library for years and it's been great for our usage requirements, but we recently encountered a use case (a secure redirect utilizing information passed through the LTI data to authenticate access) where the database configuration was entirely excessive. We don't really have any need to log anything for this use case and the LTI is essentially a glorified redirect script (obviously more or we wouldn't have made it an LTI).

We've looked and looked, but it doesn't appear that the class currently supports a setup that does not utilize a database. We understand that the level of resources needed is negligible, but we subscribe to the belief that the fewer things involved in a process makes for a process less likely to break.

So, the question is: can we use this class hardcoding a secret and key for the handshake, instead of looking it up in a database? If so, what did we miss in how-to do it?

spvickers commented 4 years ago

The library can certainly be used without a database - you can write a subclass to the DataConnector class which implements access to those objects you wish to use. For example, the saLTIre test tool uses the library in conjunction with the PHP session rather than a database.

cesbrandt commented 4 years ago

That's basically what we thought would need to happen, but we wanted to ask if we had simply missed it already being in the library.

Thank you for the timely response.

spvickers commented 4 years ago

I'm not sure what you plan to replace the database with, but if you feel it might be of wider interest, please feel free to share your code so I can add it to the library.