Integrating Our Cloud Development Suite with Google Apps

This is part 2 of a 2 part blog series. In Part 1 I discussed authentication using OpenID Single Sign-On.
Couple Jira Studio with Google Apps and you have a complete set of software development and collaboration tools in the cloud. In this blog post we’ll look at how you too can integrate your application with Google Apps using open standards and alert you to some of the hidden gotchas relating to data access.

Data Access with the Google Apps APIs

Once you have your app’s user-base hooked up with Google’s, you’re ready to start getting access to some of that sweet data.
As with authentication, there have been many protocols for secure data access. Network-level RPC (remote procedure call) mechanisms have been around for ages and usually comprise a communication protocol over a socket. You can always roll your own, but why would you when there has been significant effort put into standardising the communication protocols for web-based RPC. Internally at Atlassian we have been starting to expose REST end-points to provide developers with access to data.
Google offers a rest-inspired API for accessing and mutating data stored in Google Apps. This set of APIs are generally well-documented and provide access to a host of content including:


The sweet thing is that Google already provides client implementations to access data through these APIs to help kick-start development on integration points.
It’s one thing to provide well-defined APIs but it’s another thing to authorise access to them. Google provides a few mechanisms to get access to protected data, including basic username/password-based authentication. This option will require the user to enter their Google password in order for your web app to access their Google data. The clear downside is that the user will be entering their Google password on your app!
Just like OpenID is becoming the standard for delegated authentication, it’s sibling OAuth is becoming the standard for delegating secure access to data. The OAuth protocol allows a user to authorise secure access to data from one service to another service. A classic use-case is allowing Facebook to import potential friends from your GMail contacts, without you actually handing over your GMail password to Facebook.
Google has implemented both 3-legged and 2-legged versions of the OAuth protocol to allow secure access to it’s data APIs. The 3-legged version of OAuth (3LO) requires a user to explicitly allow access data. So if you wanted to embed a Google Doc in a Jira issue, then the user would need to authorise Jira Studio to allow access to the Google Docs API. Although this ensures the user never has to enter their login details to Jira Studio, the user-experience will start to get annoying.
In contrast, the 2-legged version of OAuth (2LO) specifically takes the user out of the equation. In this situtation, Google Apps trusts Jira Studio to make requests to certain API’s. The advantage of this approach is the user no longer needs to authorise access to Jira Studio – instead, the administrator sets up the trust relationship in Google Apps. Google have made this process easy with the introduction of the Google Marketplace. Developers define a collection of API scopes that’s used by their application to access Google Apps data. When an admin purchases an application, they authorise the application access to the API scopes.

If you’re looking to get started with 2LO access, it’s best to just dive straight into the code to see how easy it is to get started
There are some things to watch out for when using OAuth for the Google Data API’s:

Beyond Basic Integration

Google have provided a convenient platform for integrating existing and new applications with the Mail, Docs and Calendaring services provided by Google Apps.
We’ve cranked it up a notch and have also integrated:

Miss part 1 of this blog? Integrating Atlassian’s hosted development suite with Google Apps »

Want to see the integration at work? Try Atlassian’s software development suite in the cloud »

Exit mobile version