Authentication Modules and Google Apps Accounts

Authentication Modules and Google Apps Accounts

by Tony Hall -
Number of replies: 16
Hi All... I would like an authentication module that uses hosted google apps accounts (not just a google account) to authenticate in a similar way to pop3 and imap.

After reading around it seems others do as well and I have developed some php code that is able to check whether a username/password combo is able to authenticated against a google hosted domain, based on the general idea covered here:
http://tracker.moodle.org/browse/MDL-10924 and
http://code.google.com/apis/accounts/AuthForInstalledApps.html#Parameters

A basic example of the authentication code, to prove the concept, is here http://itvet.org/googaps/ .

If you enter a domain hosted by google along with a correct username and password it should authenticate. I found you can also use similar code to authenticate anyone with a google account, however, for implementation into moodle, I want to be able to specify the hosted domain in the authentication module settings so that people from other google hosted domains are unable to authenticate, hence the separate field.

I am trying to now convert this small segment of code into an authentication module and am wondering what is required. I have tried searching the moodle documentation but the Authentation module stub is empty http://docs.moodle.org/en/Developer_documentation#Make_a_new_plugin

Can someone let me know what is required either by posting back here or completing the page for authentication plugins.

Average of ratings: -
In reply to Tony Hall

Re: Authentication Modules and Google Apps Accounts

by Tony Hall -
After looking at the POP3 authentication method I think I have it figured out... I have created files for
auth/googaps/auth.php
auth/googaps/config.html
lang/auth_googaps.php
and the authentication method is working. If I use a valid hosted google apps account and password I am successfully logged in to moodle and taken to a page where I am asked to populate the remaining fields for my moodle user account... eg. First Name, Last Name etc.

So my next question, some of these fields (eg email address) could be filled automatically by using details retrieved from my hosted google apps account, How do I get the account creation moodle fields to be automatically populated with the relevant data?
In reply to Tony Hall

Re: Authentication Modules and Google Apps Accounts

by Dave Stacey -
Hi,

I'm hoping that this can offer me something I'm looking for at the moment, but I wanted to check before starting to install anything.

We've got a Google Apps for Education account on the same domain name as our Moodle. What I would like is that when someone has logged into Moodle, they click the link through to their email, or calendar, or google docs, and they go straight through - Google Apps grabbing the user details from Moodle.

Is that a) possible?
b) possible with this module?
c) possible with this module if we're running Moodle 1.9?

Cheers,

Dave
In reply to Dave Stacey

Re: Authentication Modules and Google Apps Accounts

by Tony Hall -
Hi Dave...

This module does not do that. It merely authenticates for moodle against the google user accounts for your domain. It does not sign into any other google services.

I think there is another team who is working on a tighter integration between moodle and google apps... try here http://moodle.org/mod/forum/discuss.php?d=82494

Tony
In reply to Tony Hall

Re: Authentication Modules and Google Apps Accounts

by Dave Stacey -
Hi Tony,

Thanks for the reply. I'll go and have a look at that link.

All the best

Dave
In reply to Tony Hall

Re: Authentication Modules and Google Apps Accounts

by Tony Hall -
I am happy enough with it now and have uploaded the files to the modules section of this site... the link above http://itvet.org/googaps/ now points to the download site for the authentication module rather than the test page.

If anyone else is using google apps on their domain please try the module out and let me know of any bugs.
In reply to Tony Hall

Re: Authentication Modules and Google Apps Accounts

by Jai Gupta -
Tony, thanks for the cool plugin.
In reply to Tony Hall

Re: Authentication Modules and Google Apps Accounts

by Syamsul Anwar -
Thanks Tony for the great plugin.

Would also like for some information (e.g. email address) in the Moodle account profile page to be filled in (and set as unchangeable) automatically if possible.
In reply to Tony Hall

Re: Authentication Modules and Google Apps Accounts

by Jawahar Manickam -
Hi Tony

I used the googaps for our email and it works fine in 1.8 then I upgraded the same server to 1.9+ it worked fine.

But when i migrates the server to the new servers (followed all the instruction used for migration) everything is fine.

But my googaps authentication is not working / no errors.
So i downloaded the latest but nothing happens.
can you help me?

In reply to Jawahar Manickam

Re: Authentication Modules and Google Apps Accounts

by Jawahar Manickam -
Hi

There is an compatibility issues in Ubuntu 8.04 for GOOGLE HOSTED account authentication.

So finally I moved from 8.04 to Feisty 7.04 and it works fine.

If you migrate you moodle from old to new server you may have unicode environment problem. If it comes please convert your database to UTF8.
using

ALTER DATABASE `moodle` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

smile



In reply to Jawahar Manickam

Re: Authentication Modules and Google Apps Accounts

by Robin Carriere -
Sorry to revive / hijack the thread but wanted to post a solution to the ubuntu 8.04 problem. The likely reason it didn't work on your new install is that the ca-certificates are probably not installed. To do this type in:
apt-get install ca-certificates

You can check yourself from the command line by typing in:
curl https://www.google.com/accounts/ClientLogin -d Email=brad.gushue@example.com -d Passwd=newfoundland -d accountType=GOOGLE -d source=Google-cURL-Example -d service=lh2

if you get a response like "curl: (77) error setting certificate verify locations:" then you are missing the certificates.


In reply to Tony Hall

Re: Authentication Modules and Google Apps Accounts

by Martín Langhoff -
Hi Tony,

you can just use the standard auth/pop3 plugin for this. No need to make a new plugin AFAICS. For a more advanced setup, you can use the shibboleth plugin for SSO with Google Apps.
In reply to Martín Langhoff

Re: Authentication Modules and Google Apps Accounts

by Tony Hall -
If you use the standard POP3 authentication plugin you need to get every user to go into their google accounts and activate POP3 before you can use their account in moodle... with my module you simply specify your google apps domain in the settings and the users don't have to enable anything in their own accounts.
In reply to Tony Hall

Re: Authentication Modules and Google Apps Accounts

by Martín Langhoff -
Ah! Ok -- is it using the GA API?
In reply to Tony Hall

Multiple Copies of Google Apps Auth Plugin

by Gene Liverman -
Would someone mind telling me what I need to edit so that I can run four copies of this plugin? I want to authenticate off of four different Google Apps domains.

Secondly, do the accounts just have to be created in Google Apps or must they have email addresses? We currently do not use Google Apps for the email side.

Thanks,
Gene
In reply to Tony Hall

Re: Authentication Modules and Google Apps Accounts

by Wayne Gibcus -
I received an error recently regarding this module. I was getting the following error message "You cannot proceed without changing your password. However there is no available page for changing it. Please contact your Moodle Administrator." with newly created accounts. Turned out there as a problem with password complexity. I've been using this module for over a year and never seen this problem before. Perhaps a change in policy by Google?