Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

We are looking for a way using which users can login into Drupal site using their Google Apps account user name and password. We use 'Google Apps for Education' and we do not want maintain separate username and password for our Drupal site.

We would also like to limit access to certain users having Google Apps accounts. Something like filtering or pre-approved account list. And, users' account should be created automatically when they login for the first time, and they should not need to fill any additional account information in Drupal, it should be directly pulled from Google Apps account.

Is there any module for Drupal 7 that provides this functionality? I have already tried OAuth, Loginza.ru, OpenID etc. like approaches and these are not what we are looking for.

If there is no such module, how shall I proceed with writing a custom module for the same?

share|improve this question

4 Answers 4

You shouldn't need to write a custom module from scratch there's plenty of code to get you started.

share|improve this answer
1  
Sadly, direct support went into Drupal 7... and then was removed later: drupal.org/node/727650 - you may find useful work there. –  rfay Sep 1 '11 at 20:00

I have played with the Janrain Engage (formerly RPX) module using the janrain.com service. The pricing is pretty low if you don't have a massive user base. For Google, it will give you the user's email and full name (https://rpxnow.com/docs/providers)

share|improve this answer

To integrate your Drupal 7 site with Google Apps, you need to:

  1. Enable the OpenID module on your drupal site
  2. Enable the Federated Login Service using your Google Apps control panel at http://www.google.com/a/cpanel/yourdomain.com/SetupIdp
  3. Add an X-XRDS-Location header at yourdomain.com/openid For example, if yourdomain.com is a PHP site, upload this as /openid/index.php

    <?php
    header('X-XRDS-Location: https://www.google.com/accounts/o8/site-xrds?ns=2&hd=yourdomain.com');
    ?>
    
  4. Go to your drupal site's login page. You'll see a new 'login with open id' link. Click it. Enter: https://google.com/accounts/o8/site-xrds?hd=yourdomain.com and click submit
  5. The first time you do this, you'll be asked if you want to allow your site to authenticate. Click yes.
  6. Subsequently, if you try to login using the above URL and you are logged in to Google Apps, you'll be logged in directly.
share|improve this answer

For anyone with a simple use case (just let users login via Google), look at the Google Identity Toolkit (GITkit) module:

This module allows users to login / register on a Drupal website using their Google login credentials via the Google Identity Toolkit API available on http://code.google.com/apis/identitytoolkit

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.