Google Cloud Ruby API Authorization / Client / Token handling -
i'm struggling bit google cloud ruby api in rails app , looking guidance. here's few questions , appreciated.
key = google::apiclient::keyutils.load_from_pkcs12('file.p12', 'notasecret') client = google::apiclient.new({:application_name => "app name", :application_version => "1.0"}) client.authorization = signet::oauth2::client.new( :token_credential_uri => 'url', :audience => 'audience', :scope => 'scope', :issuer => '', :signing_key => key) client.authorization.fetch_access_token!
probably important:
"client.authorization.fetch_access_token!"
does need called every time? supposed saving off access token , using until expires or library take care of me?
what for? works is, copied value example found online. should using differently?
'notasecret'
:application_name , :application_version -- these used for? doc doesn't say. "the name of application using client." seemingly can send in here... http://www.rubydoc.info/github/google/google-api-ruby-client/google/apiclient
thanks help. it's bit frustrating lack of docs on authentication side of things ruby library google.
Comments
Post a Comment