Skip to content

Using --key option and authenticated link. #91

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

Closed
xt0ph opened this issue May 7, 2014 · 2 comments
Closed

Using --key option and authenticated link. #91

xt0ph opened this issue May 7, 2014 · 2 comments

Comments

@xt0ph
Copy link

xt0ph commented May 7, 2014

As I saw in #1 I try to activate the restrictions in Ehercalc.

I have to added '--key' in launching the Ethercal server and now when I open an existing sheet, her is opened in view mode and when i adds '/edit' to the url i can modify it, great. But there is a problem: the icons in the toolbar are not showing in edit mode, how to fix this?

And I continue the configuration to activate and use authenticated links always in #1, it is indicated to modify the file 'main.coffee', but in my version i not found this file. The only file that contains the line "@ get '/: room / edit': ->" is "src/main.ls" and when I commented these 3 lines nothing is happening. What I forgot?

Thank you very much for your response

@xt0ph
Copy link
Author

xt0ph commented May 29, 2014

Ok, I answer to myself because I solved my two previous points, the first is fixed by put a rewriting rule in nginx, and the second by modifying the 'main.ls' file instead of 'main.coffee' and by executing the makefile.
But in this case, if the sheets are editable only by '... / Room? Auth = ', on the other side each has its local version and there is more collaboration on the same sheet.

Am I the only one to have this pb?

Regards

@audreyt
Copy link
Owner

audreyt commented May 30, 2014

Hi! Sorry for the late reply.

If you are integrating EtherCalc to a CMS, please make sure that that ?auth= parameter is correctly calculated. Sample code below is in Node.js:

    var KEY = '...'; // the --key parameter passed to app.js
    var SHEET = '...'; // the spreadsheet name being authenticated
    var encoder = require('crypto').createHmac('sha256', KEY);
    encoder.update(SHEET);
    var auth = encoder.digest('hex');

This calculation is done by /SHEET/edit automatically, so another way is to make a server-side request against that URL and parse its redirection response.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants