开发者

Handling user authentication for external users without data being in the Drupal system

开发者 https://www.devze.com 2023-01-13 22:03 出处:网络
I am working on a specific case where the user authentication is external from the Drupal site. The external site will authenticate the user and return the basic user related data to the Drupal system

I am working on a specific case where the user authentication is external from the Drupal site. The external site will authenticate the user and return the basic user related data to the Drupal system.

The catch here is that, we are not supposed to have any user data in the Drupal DB. I have checked the user_external_login_register() but it does not work since it saves the user data in the database. So can someone please direct me 开发者_StackOverflow社区as to how this can be done.

Thanks so much in advance, Vinay


user_external_login (http://api.drupal.org/api/function/user_external_login/6) is probably as close as you can get. It ignores the password stored in the drupal users table, so the passwords could be random data if needed.

You could also mash a bunch of data onto global $user to get some semblance of a normal login.

But, you'll only get so far in a drupal environment without storing user info in the database. Many basic operations call the user_load() function, which depends on useful information being available in the database.

For example, most user-based views ("My Groups", "My Recent Posts", etc) call user_load instead of accessing the global $user object.

0

精彩评论

暂无评论...
验证码 换一张
取 消