I've integrated Google Drive with my app and it was all working well until today. I didn't change any of the code or client ID's and now getting this error when authorizing GDrive on our site:
Google::APIClient::ClientError
Could not retrieve discovery document at: https://www.googleapis.com/discovery/v1/apis/oauth2/v2/rest
I'm using the Ruby Google Api Client, here's the code where the error is thrown:
require 'google/api_client'
gclient ||= (begin
client = Google::APIClient.new
client.authorization.client_id = Rails.application.config.gdrive_client_id
client.authorization.client_secret = Rails.application.config.gdrive_client_secret
client.authorization.redirect_uri = "#{request.protocol}#{Rails.application.config.host_url}/users/auth/gdrive"
client.authorization.access_token = auth_token.token
client.authorization.scope = [
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile"
]
client
end)
result = gclient.execute!(
:api_method => 'oauth2.userinfo.get',
:version => 'v2'
)
The error comes up at "result = gclient.execute!". Did something change in the Google Ruby API client library?