Question

I'm using the (alpha) Ruby google-api-client to interact with various services for our organization's Google Apps instance.

I'd like to discover the provisioning services API, authenticate a user with a service account, and update their password.

So far...

require 'google/api_client'

class GoogleProvisioningConnection
  def initialize(user_email=nil)
    @client = Google::APIClient.new
    @provisioning = @client.discovered_api('???', 'v2') # what's it called? user?

    key_file_name = 'mykey-privatekey.p12'
    key = Google::APIClient::PKCS12.load_key(key_file_name, 'notasecret')

    asserter = Google::APIClient::JWTAsserter.new(
      '...@developer.gserviceaccount.com',
      '???', # which url allows me access to their user?
    key)

    @client.authorization = asserter.authorize(user_email)
  end

end

Which string is used with @client.discovered_api to get at the provisioning API?
And when the JWT asserter is used, which service url should be requested?
Thanks

Was it helpful?

Solution

The Provisioning API uses the old gdata protocol. It won't work with the new discovery based libraries.

You should use the GData Ruby Library.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top