如何从Drupal的反对Django的认证? [英] How to authenticate against Django from Drupal?

查看:401
本文介绍了如何从Drupal的反对Django的认证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个中等规模的Drupal 6站点上运行(约每月5万的页面浏览量超过30K注册用户),我需要整合OSQA,Django应用程序,用它。我已经有很多用户,角色和权限在我的Drupal数据库,我想指出的Django应用程序使用的注册和登录页面我已经在Drupal给我的用户入口上的一个点。

I have a medium sized Drupal 6 site running (around 5 million page views per month and more than 30K registered users) and I need to integrate OSQA, a Django application, with it. I already have many users, roles and permissions in my Drupal database and I'd like to point the Django app to use the sign up and login pages I already have in Drupal to give my users a single point on entrance.

我想保持Django的认证部分,因为我觉得OSQA会更好地工作。我也有考虑到性能的原因,Drupal站点已经得到了大量的流量,有一个非常繁忙的数据库,我觉得用一个单独的数据库的Django会有所帮助。

I want to keep the Django authentication part because I think OSQA would work better. I also have performance reasons in mind, the Drupal site already gets a lot of traffic and has a very busy database and I think that using a separate database for Django would help.

经过一番研究,我想我可以让Drupal的注册和登录页面调用的Django在后台注册或登录到Django应用程序。我打算这样做写在Django,一个用于注册,另一个用于登录一对夫妇的意见,和Drupal会后对这些意见的用户名和密码。当然,我需要在Django禁用CSRF对于这些观点,可能还发布一些秘密密钥,只有我的Drupal和Django应用程序知道,以避免外部网站试图用这种无保护Django的意见。

After some research I think I could make the Drupal sign up and login pages call Django in the background to sign up or login to the Django app. I plan to do this writing a couple of views in Django, one for sign up and another for login, and Drupal would post the username and password to those views. Of course I'd need to disable CSRF in Django for those views and probably also post some secret key that only my Drupal and Django applications know about to avoid external sites trying to use this "unprotected" Django views.

我知道我的Django的应用程序可能需要从Drupal的某些用户数据在某些点,我打算使用Drupal的服务模块的。

I know that my Django application may need some user data from Drupal at some points and I'm planning on using the Drupal services module for that.

这会是一个好方法?有什么建议?

Would this be a good approach? Any suggestions?

非常感谢!

推荐答案

如果您可以张贴到Django的形式,你可以使用的 drupal_http_request 处理调用Django的。使用ldap_integration模块一段时间后,我曾使用drupal_http_request调用一个基于Java的REST API认证自定义验证模块。如果你有兴趣在code,让我知道。

If you can post to the Django form, you may be able to use drupal_http_request to handle the call to Django. After using the ldap_integration module for a while, I worked on a custom authentication module that calls a Java-based REST authentication API using drupal_http_request. If you're interested in the code, let me know.

这篇关于如何从Drupal的反对Django的认证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆