Needs update for latest ldap-7.x-2.x as there is now an additional argument for the _ldap_authentication_user_login_authenticate_validate function to indicate it needs to return the user object.

CommentFileSizeAuthor
#1 services_user_ldap_1959108.patch943 bytesjrreid

Comments

jrreid’s picture

Status: Active » Needs review
StatusFileSize
new943 bytes
ajlow’s picture

Issue summary: View changes

Is there a way to include the CSRF token in the response back?

Previously, when I use the /user/login service call, I managed to get the correct CSRF token. After including this module and patch, it is not returned with the response.

I have tried using the /services/session/token to retrieve the CSRF token, however it seems to be the incorrect one as I keep getting CSRF Validation Failure errors whenever I use the /system/connect web service to check whether the session is still valid.

Interesting thing is this is only affecting my Android app as I had to write the web service calls by hand. My iOS app uses the Drupal iOS SDK.

Please let me know if you have any questions.

Thank you for your help!

ajlow’s picture

I've figured it out now. What you need to do is add the following line after $return->session_name = session_name(); in the patch:

$return->token = drupal_get_token('services');

Note the parameter'services'. This is important as you will otherwise get a CSRF validation error.

I copied this from the login function in the user_resource.inc: /services/resources/user_resource.inc.