Google Authentication for Web Applications

Primary tabs

Web applications that need to access services protected by a user's Google or Google Apps (hosted) account can do so using the Google Authentication service. This service lets web applications get access without ever handling their users' account login information. Many but not all Google services support the Authentication service; check first with the service you want to access.

Google offers two libraries for handling authentication: one using the OAuth open standard, and a second interface called AuthSub, developed prior to the release of the OAuth standard. This module implements the AuthSub interface.

Factors to keep in mind when choosing between OAuth and AuthSub authentication:

Read More about OAuth - Universality: If your application will need authentication from other service providers as well as Google (assuming those providers support OAuth), use OAuth to avoid having to set up multiple authentication mechanisms.

Read More about AuthSub - Security: AuthSub allows for registered and unregistered access, offering several options with regard to security requirements. OAuth requires web applications to register with Google and sign all requests.

The basic usage of this module requires you to include a call to google_auth_required() with the URL identifying the service(s) to be accessed. Here is an example of how to use it to authenticate with the Picasa service from Google: