Jump to content
X2Community Forums

Google Integration Improvements


Recommended Posts

Hello all,

 

As a part of our next release I have completely revamped our Google Integration features. In addition to being able to access your Google Drive through the software, logging in with your google account is easier, and you are no longer asked to confirm your permissions on every request. However, as a result of this we will be requiring more permissions if you want to use your Google account with our software.

 

What does this mean for users?

 

1) Google+ Profile for Google Login: Google's official login script requires use of a Google+ profile to log in with the software. Personally I don't know how this one is going to go. A lot of people don't use their Google+ profile on their account and might not have it activated. If you aren't able to use your Google+ profile, then the Login with Google feature will not work. That said, I believe that the Drive integration and Calendar integration should still function if you set your permissions on those pages instead of on the Login page. If they stop working because of this requirement and people are having issues, I will re-evaluate this login method.

 

2) Google Drive Access: With the new Drive Integration, you'll be able to Upload files into Drive through X2 and associate them with a record, view a list of your Drive files from the media widget, and attach files from your Google Drive account to Emails you send to Contacts through the software. As a result of this, Google Integration will now require Drive permissions from users.

 

What does this mean for admins?

 

1) Your Google API Console will need some new configuration. The Google+ API and Google Drive API services will need to be turned on to allow for the new integration to work. 

 

2) New redirect URIs and a new Javascript Origin will be required on your Google API console. You can view a list of required redirect URIs on the "Google Integration" page from the Admin tab. Your own server will be required as a Javascript Origin in your API console. All of this information will be found on the Google Integration page.

 

What does this mean for developers?

 

1) Easier use of Google PHP API. I've written a new class called "GoogleAuthenticator" that makes connecting to Google's API much easier. All you do is load the class and call "getAccessToken()" if a user has already authenticated before, or send them to a URL created by "getAuthorizationUrl(null)" Additionally, you can get properly configured Calendar Services and Drive Services by calling "getCalendarService()" and "getDriveService()" respectively. 

 

2) More integration coming in the future. With how easy it is to build out an integration to one of Google's API services now, we can seriously consider offering more integration options (analytics, contacts, blogger, etc) in the future. 

 

The Bottom Line

 

I've made a lot of improvements across the board to the Google Integration features of the software. In addition to this, Drive integration has been added. Users will need to give more permissions to use the new services and Admins will need to update their API console. Additionally, several bugs have been fixed with the Calendar Sync that I noticed while refactoring the code.

 

Warnings

 

Google's API can be nasty with the exceptions they throw on occasion. This is a preliminary release of the code so I am not going to try to add handling for every possible exception, just the ones that could immediately break the codebase. As long as a token is properly generated, I haven't seen any issues... but occasionally you get improper token creation or other problems with permission levels and exceptions may be thrown.  If you see one, please inform me immediately so I can add handling for it or try to prevent it from happening int the future.

 

Jake

Link to post
Share on other sites
×
×
  • Create New...