Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I secure a Java REST service using Drupal?
    primarykey
    data
    text
    <p>I am creating a web application that uses the Drupal 7 Content Management System. The web pages heavily use JQuery and AJAX. </p> <p>The AJAX calls hit REST services, which are actually implemented using JAVA. Apache is running Drupal 7 and is configured to pass any calls to the REST urls through to the Java EE server (Jboss AS7). Everything is over SSL.</p> <p>I need to Authorise and Authenticate calls to the REST services, and access the username or ID of the person currently logged-in to Drupal from the Java app. The question is... how...</p> <p>As the AJAX calls are made to the same Apache server (rather than to a separate server etc), everything happens within the same http session, so I'm hoping this will be quite easy.</p> <p>Things I've thought-of:</p> <ul> <li>Configure a java security interceptor that calls a custom (locally accessed only) drupal service that somehow reads the session id and returns the logged-in username</li> <li>create a "dumb" drupal REST service to act as a gateway for all of my REST calls, which authorises/ authenticates then injects the username before passing-through to the Java backend service</li> <li>The article at <a href="https://lists.wisc.edu/read/messages?id=7777296#7777296" rel="nofollow">https://lists.wisc.edu/read/messages?id=7777296#7777296</a> made me wonder if I could get-away with calling a Drupal service (just at the start of each Java service session) that takes a Drupal sessionID and returns the current user and his roles. I could configure it in my Java service so it would reperform this call every x seconds or y calls to check for role changes or logouts.</li> </ul> <p>How does everyone else do it? This must be a common problem to solve isn't it? If not, what do you do instead to securely access authenticated services over AJAX? I'd rather not introduce a second user control process in addition to Drupal unless it's unavoidable. DRY :)</p> <p>Thank you - this has me stumped!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload