Toby Allen
Toby Allen

Reputation: 11213

External site Authentication with Drupal 7

I apoligise if this has been asked many times before, but I'm wondering if anyone has a link to a good tutorial on implementing a working remote authentication system in Drupal 7. I'm new to Drupal.

I've found various examples online, but the system for doing this seems to have changed substantially between Drupal 5 to 6 to 7.

I have a working system that will allow me to authenticate a user remotely and adds the user to my drupal installation. However now I cant log in any Drupal only accounts (eg the admin) as I get an error saying that the username is unknown since the code is looking for my admin username in the external system.

I get an unrecognised username error. The code is being executed for both an external and an internal user.

I know its something simple.

Upvotes: 0

Views: 4878

Answers (1)

krishna singh
krishna singh

Reputation: 1073

External site login

Case on same server and try from any store on same path

like /store

define('DRUPAL_ROOT','D:/wamp/www/drupal');

require_once '../includes/bootstrap.inc';

drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

global $user;

//change this line and put your username and password instead of 'admin' and 'password'

$account = user_authenticate('krishana', 'hiddens');

$user = user_load($account, TRUE);

drupal_session_regenerate();

Upvotes: 2

Related Questions