Hi !

I was wondering if someone has succeeded in using Services out of the box (i.e. no additionnal authentication module) from Javascript.

My concern is that I want to create a Ionic application based on a Drupal backend. But when I want to expose services with Services module, I can't go further than login a user.

When login a user, I get a "token" that I use as a x-csrf-token on later requests, but this is not efficient and I only get the "Access denied for user anonymous" response when trying to access a protected ressource (with superadmin credentials).

Is there a special configuration to set from JS ? I've spent days on that problem and can't see any tutorial or documentation refering it. Some help would be valuable !

Regards,

Comments

Fabien Crépin created an issue.

tyler.frankenstein’s picture

This is why I created jDrupal, perhaps it will be of use to you here.

tahiticlic’s picture

Hi, thanks, I had a look on documentation, but it seems that it is for same domain isn't it ?

My concern is for a mobile app communicating with a Drupal website. And that doesn't work using session authentication, I'll have a try with basic auth even if not very convenient.

tyler.frankenstein’s picture

It can be used within the same domain, and it can be used within mobile applications. Case in point, DrupalGap is dependent on jDrupal (which is dependent on Services), and DrupalGap is used to build mobile apps and headless/decoupled apps.