如何"发现"Google的Provisioning API?

tbe*_*eda 0 ruby google-api google-apps google-provisioning-api google-api-ruby-client

我正在使用(alpha)Ruby google-api-client与我们组织的Google Apps实例的各种服务进行交互.

我想发现配置服务 API,使用服务帐户验证用户身份,并更新其密码.

至今...

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
Run Code Online (Sandbox Code Playgroud)

使用哪个字符串@client.discovered_api来获取配置API?
当使用JWT断言器时,应该请求哪个服务URL?
谢谢

Jay*_*Lee 5

配置API使用旧GDATA协议.它不适用于基于新发现的库.

您应该使用GData Ruby Library.