Integrating your Drupal site with Launchpad
You can now integrate your Drupal 5.x site with Launchpad using our two new Drupal modules:
openid-launchpad: lets you use Launchpad as a single sign-on provider
openid-teams: assign roles to your Drupal site users based on their memberships of specific Launchpad teams.
This means you can build a community site outside of Launchpad that can take full advantage of the power and flexibility of Drupal, and its extensive list of third party modules, while maintaining strong links with your development activity and community in Launchpad.
To use the Launchpad modules, you must be running Drupal 5.x and use Launchpad's modified version of the Drupal OpenID plugin, which you can download from its Launchpad page.
Downloading and installing
You can find the Launchpad Drupal modules on the main Drupal site:
Alternatively, you can get hold of the very latest bleeding-edge code direct from Launchpad. First, cd to your Drupal modules directory, then:
$ bzr branch lp:drupal-openid openid $ bzr branch lp:drupal-launchpad launchpad $ bzr branch lp:drupal-teams teams
Installation is straightforward: follow the standard module installation instructions in the Drupal documentation.
Configuring the Launchpad module
The Launchpad module sets some sensible defaults for the most likely usage of Launchpad as a single sign-on provider. There are, however, some additional steps you may have to take to ensure your existing Drupal configuration is suitable:
To ensure your users can log in with the minimum of interruption, go to "Administer > User Management > User Settings" and make the following changes:
- In the section labelled "Public registrations", select the most appropriate option. If you want any authenticated Launchpad user to be able to log in to your site, or if you want to use the teams module to restrict logins to members of certain teams, you should select "Visitors can create accounts and no administrator approval is required".
- If Launchpad is configured to return email addresses as part of the log in process (see 'Registering your Site with Launchpad' below), uncheck "Require e-mail verification when a visitor creates an account" unless you want your users to verify their email address when they sign in to your site for the first time.
Add the login block to your site by going to "Administer > Site Building > Blocks" and making the following changes:
- Set the "User login" block region to "None"
- Set the "Launchpad Login Button" block region appropriately for your site.
- Click "Save blocks"
- Click "configure" for the "Launchpad Login Button" block and:
- Select the appropriate server from "Select server:". In most cases this would be "Production".
- In the section labelled "Page specific visibility settings", select "Show block on specific pages:"
- In the text box labelled "Show on every page except the listed pages.", add the follow entries (1 per line): 'user', 'user/*'
- Click "Save block"
These are the Launchpad-specific settings which are available:
Prevent users from accessing 'My Account' functionality. This hides the "My Account" page from your users and may be useful if you want to have closer integration with Launchpad. Disabled by default.
Keep users' name and email in sync with Launchpad. This will ensure that your users' usernames (and email addresses if your site is registered with Launchpad) are synced with Launchpad every time they login. Enabled by default.
Prevent users from using the registration form. This will prevent non-Launchpad users from creating accounts on your site and will also prevent registered users from retrieving their password from your site in order to login with their drupal username and password rather than using Launchpad. You can still create individual users or assign passwords manually if you need to give individuals non-Launchpad access to your site. Enabled by default.
Registering your site with Launchpad
Launchpad uses OpenID to provide its single sign-on facility to external sites. Using the Simple Registration Extension (SREG) you can request additional data about the user during the login process. In order to protect the privacy of Launchpad user, Launchpad limits the data that it returns to untrusted sites. By default, Launchpad will only return a user's username if it is requested and will ignore any other requests. The Launchpad module for Drupal takes account of this limitation and allows your users to enter their email address manually when they log in to your site for the first time.
If you would like to avoid this step and also allow your site to keep users' email addresses in sync with Launchpad, you will need to add your site to Launchpad's list of trusted sites.
To do that, please file a question on the Launchpad project telling us your site's trust root or realm. A trust root is what Launchpad (and other OpenID providers) use to identify your site and check its entitlement to user data. You can find your site's trust root in Drupal's "Administration Site configuration OpenID Settings".
Changing the Launchpad environment
Launchpad has three main environments:
production: for everyday use, lives at https://launchpad.net
edge: updated throughout the Launchpad development cycle using the Launchpad team's latest code, uses the live database
staging: updated daily using the Launchpad team's latest code, database is reset every night.
By default, the module uses the Launchpad's production server. You can change to edge or staging in Drupal's Administer > Site Building > Blocks > Launchpad Login Button section. The teams module allows you to assign Drupal roles to users each time they log in, based on their membership of Launchpad teams you specify. In Drupal, go to Enter a Launchpad team id in the empty Select a Drupal role from the drop-down list (see below). When you select which roles to assign to people with certain team memberships, you should create Drupal specifically for that purpose. This is because the Teams module assigns these roles automatically on login and then unassigns them on logout, regardless of how they were originally assigned to the user. The Our Drupal module is ready to assign roles based on team information coming from several different OpenID providers. However, before you can use the teams module with a provider other than Launchpad, you need to set the new provider in the Please submit your feedback, questions and bug reports for any of these modules at the drupal-openid project on Launchpad.
Configuring the teams module
Administration Site configuration OpenID Teams/
Assigning Drupal roles
Feedback, questions and bug reports
The teams module allows you to assign Drupal roles to users each time they log in, based on their membership of Launchpad teams you specify.
In Drupal, go to
Enter a Launchpad team id in the empty
Select a Drupal role from the drop-down list (see below).
When you select which roles to assign to people with certain team memberships, you should create Drupal specifically for that purpose. This is because the Teams module assigns these roles automatically on login and then unassigns them on logout, regardless of how they were originally assigned to the user.
Theopenid-teams module implements an extension to the OpenID standard. As the proposer of the standard, Launchpad is currently the only OpenID provider that implements it. However, it's open for anyone to implement.
Our Drupal module is ready to assign roles based on team information coming from several different OpenID providers. However, before you can use the teams module with a provider other than Launchpad, you need to set the new provider in theTrusted Providers list. If you're only using Launchpad as a provider, you can ignore it.
Please submit your feedback, questions and bug reports for any of these modules at the drupal-openid project on Launchpad.