Licensing System For Client Side Code Web Application
I have a client-side web application running on SharePoint Site Collection, each site collection has it's own unique id. I want to use a licensing process to lock the app to a site collection.
This is the challenge-response process I'm trying to implement:
- User prompted to generate
challenge code
challenge code
issite_collection_id
processed through some function- User emails me
challenge code
- Encrypt
challenge code
with aprivate key
- The encrypted result is considered the
license key
which I send to user - User saves
license key
into the application
Validation Process:
- On app load, retrieve
license key
- Decrypt
license key
using apublic key
stored in app - The result is the
challenge code
the user had sent before - Take that
challenge code
revert it back to asite collection id
- Retrieve the
site collection id
app is currently running on - Compare the two to determine if
license key
is valid
Does this make sense? The one thing I'm not sure about is the public/private key stuff and if there's a way to do this in JavaScript.
I know it's impossible to 100% secure client-side applications. I'm just looking for something to prevent someone from easily distributing the application
Answer
You can use public/private key in javascript, I just used in my recent project. Check openpgp.js. The scenario you describe looks fine. You may also use daily tokens client will ask your server to be able to run, sharepoint site may send the token you give them back with a request for daily license, and you send license code and a token which is valid for 24h.
Related Questions
- → How to update data attribute on Ajax complete
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → Octobercms Component Unique id (Twig & Javascript)
- → Passing a JS var from AJAX response to Twig
- → Laravel {!! Form::open() !!} doesn't work within AngularJS
- → DropzoneJS & Laravel - Output form validation errors
- → Import statement and Babel
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM