Jorre
Jorre

Reputation: 17581

How to authenticate Drupal users in an external Laravel php application

I'm looking for a way to build a php application (in Laravel) that reuses the existing users we have in a Drupal installation.

I found two suggested solutions on stackoverflow:

1) include the Drupal bootstrap and use their user_authenticate() method.

One thing I suppose will be a problem is that our PHP application is running on a different server. This approach will probably not work in such a case or can that be fixed by pointing to the Drupal sql server?

2) use the Drupal services module to authenticate users over REST

This might work over different servers/domains I suppose, but there won't be a way to automatically login users in our php app that are already logged into Drupal, or am I wrong.

3) synchronise the Drupal user data to our own SQL server

This would be a final resort, since this won't solve automatic login.

Are my thought correct in these situations. What would you suggest doing when Drupal and the PHP app are on two completely different servers/domains?

Upvotes: 3

Views: 1256

Answers (1)

Jorre
Jorre

Reputation: 17581

I ended up writing a custom provider in Laravel.

If you're interested in doing the same thing, here's what I did: Create a custom Drupal 7 authentication driver/provider in Laravel 4

Upvotes: 3

Related Questions