When using this filter on pages other than /node/add/* or /node/edit/* it throws the permission error.

CommentFileSizeAuthor
#4 etherpad-access-denied-1054616-4.patch1.14 KBsanduhrs

Comments

jucovschi’s picture

you probably have the http://localhost:9001 URL in the configuration page. Use something like http://mywebsite.com:9001

jucovschi’s picture

you probably have the http://localhost:9001 URL in the configuration page. Use something like http://mywebsite.com:9001.

jucovschi’s picture

Status: Active » Closed (fixed)
sanduhrs’s picture

Category: bug » task
Status: Closed (fixed) » Needs review
StatusFileSize
new1.14 KB

Just ran into this.
The attached patch adds a TROUBLESHOOTING section to the README where this is briefly explained.
Please review.

leturan’s picture

I ran the same problem and finded out that the frame in the web editor page needs to find the cookie sessionID from it's own server name. But the problem is that the actual code don't use the url params of admin configuration, but the $HOST_NAME of the drupal server, resulting in such an error unless the two hostnames matches ( the most often case). Moreover, the error can come simply form the minimal difference between a domain and one of its subdomain e.g.between mydomain.org and www.mydomain.org.

Here the code the change ( I have no time the left to find ou how generate a patch) :
Replace line 45 :
setcookie("sessionID", $sessionID, $validUntil, "/", ".".$_SERVER['HTTP_HOST']); // Set a cookie
by this two lines :
$url_etherpad_decomp=parse_url( variable_get('etherpad_base_url'));
setcookie("sessionID", $sessionID, $validUntil, "/", ".".$url_etherpad_decomp['host']); // Set a cookie

emcniece’s picture

Currently fighting this as well, even though my pad is not embedded in tabs.

[2013-07-18 12:38:22.683] [DEBUG] ueberDB - SETSUB - globalAuthor:a.qxfbanpOksOoxa8F["timestamp"] - 1374176302683
[2013-07-18 12:38:22.683] [DEBUG] auth - Auth failed: invalid session & pad does not exist
[2013-07-18 12:38:22.699] [WARN] message - Authentication try failed:{"component":"pad","type":"CLIENT_READY","padId":"g.43NbT582MHol1wgo$edit-body-und-0-value","sessionID":"null","password":null,"token":"t.uuUWnPQhbE78RRGpFxty","protocolVersion":2}
[2013-07-18 12:38:22.699] [DEBUG] message - to qOW97h5_vBT-Ap0JRR0z: {"accessStatus":"deny"}

This is visible in the Etherpad server debug log. I am running the etherpad server at a different subdomain and a totally remote IP, so I am not surprised to hear that there is a conflict between cookie generation. I have my URLs set in Drupal's Etherpad config, and Etherpad is accessible openly and free of restriction.

I tried adjusting line 45 with no luck.

I am curious as to why Drupal is sending over "sessionID":"null","password":null. When I connect to Etherpad manually, I can see that these values are populated - is this a related to the cookie issue?

matt v.’s picture

Issue summary: View changes

I was seeing the same "You do not have permission to access this pad" error. After reading some comments on the FAQ for Participad (which uses the same underlying etherpad-lite-client.php library), it appears that the problem I was seeing was due to running the Etherpad server on a different hostname than the Drupal server. Putting Etherpad and Drupal on the same server resolved my issue.

gaëlg’s picture

Status: Needs review » Closed (duplicate)