1

How can I Autologin to my Drupal Commons Site when I logged in to my Drupal 7 Site?

I have following two web sites.

  • (1) Drupal 7 Site ( www.drupal7.com )
  • (2) Drupal Commons Site ( www.drupalcommons.com )

Edit:

Note:

both sites are not sub-domain level. Both has different database and different source codes so, both are separate sites.

When I Login to Drupal 7 Site I want to automatic Logged in to Drupal Common Site. Can any one suggest me what are the modules/Tutorials available which will provide the auto login functionality from Drupal Commons to Drupal 7 site.

I have heard about SSO ( Single Sign-on ) But not sure is it feasible or not.

Edit: Alternate Login Options Availble Using REST API Web Service of Drupal.

  • User login using REST API for Drupal for Other Instance of Drupal.
  • Installed Services 3.x Module
  • Enable REST
  • Create "rest" service and Enable "User" Resource.
  • Authentication Method: Session Authentication
  • User Resource has following:
  • Login
  • Logout
  • Register User
  • By using following I can Login to Site:

http://mysite.com/rest/user/login?username=myuser1&password=mypasswordformyuser1 It will give me in response SESSID and SessName Value. When I am trying to logged in from Drupal 7 to Drupal Commons Site I will not be able to create cookie for second domain.

So, How can I Generate Cookie in second domain using PHP/CURL/Drupal HTTP POST Methods.

Thanks In Advance.

  • This problem appears to be common among many who use domain access, though at the moment there doesn't appear to be a perfect solution suggest you to take a look at the discussion in Drupal groups and a [similar query] (drupal.stackexchange.com/questions/16977/…) – optimusprime619 Oct 17 '13 at 6:16
  • Thanks @optimusprime619 for give good reply. I have one idea to resolve this issue Can I Create Authentication REST Service in Drupal site itself and We can use that service to Loggin into Drupal site. like Facebook API Provide the REST API. As I think it should be based on Key to be passed in URL with Username/Password to login. ( My Assumption for Next Generation Development ) – AshwinP Oct 17 '13 at 8:16
  • I'd normally suggest to consider checking the feasibility of some SSO solution that's already been tried and tested than to go with your own solution. The reason being something widely used could potentially have more features, support and less bugs and can save quite the effort spent for this. If you are certain that your case is rather unique and you can cover up the requirements quite exhaustively with custom code it should be well and good. – optimusprime619 Oct 17 '13 at 9:08
  • Actually SSO is not available for Drupal 7.x Version. I have not found anymore. – AshwinP Oct 17 '13 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.