I am currently maintaing a Rails application that relies on the Google Provisioning API. Unfortunately, this API is being phased out soon and replaced by the Admin SDK and Directory APIs.
It uses a username and password combination to login to the API and create Google Groups. Here is an example:
gapps = ProvisioningApi.new(ENV[GAPPS_USER], ENV[GAPPS_PASSWORD])
group = gapps.create_group(listserv_group.group_id, [listserv_group.name, listserv_group.desc, "blah"])
users = User.all(:joins => :user_listserv_groups,
:conditions => "user_listserv_groups.listserv_group_id = #{county.listserv_group.id}")
users.each do |u|
if !params[:excluded_members].include?(u.id.to_s)
gapps.add_member_to_group(u.email, listserv_group.group_id)
end
end
The new API uses the OAuth protocol which does have a Client Credentials Flow that allows simply using a username/password combination, but according to the book Getting Started with OAuth 2.0:
While the preceding paragraphs describe some potential use cases for this flow, these providers (Google and Amazon) have not yet implemented the Client Credentials flow in OAuth 2.0.
In short, what would be the most straight-forward way to update code like the above in order to make use of the newer API? Thanks in advance. Any help would be appreciated.