Reputation: 363
Can somebody please tell me how do I download the certificate from google cloud console for the service account. I being searching all over the place. I have downloaded the applications authorization credential "client_secret.json"
The client_secret.json has a key "client_x509_cert_url" key which takes me to the json file which has 2 certificates embedded in it. Are this the certificate? if they are how do I use it in java code. I am bit lost over here.
Upvotes: 10
Views: 20164
Reputation: 81
private_key is something like
"-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCxrDY54c6zXbPl\n47hElulfTBHWbI/03n/3ZwVhuaVnips11KyDImSdUH\n-----END PRIVATE KEY-----\n
should I remove "\n" before using it? Right now, I'm trying to sign the UTF-8 representation of the input using SHA256withRSA accordingly this document https://developers.google.com/identity/protocols/oauth2/service-account#httprest
Please correct me if there is anything wrong with the answer here JWT Computing the Signature SHA256withRSA
Upvotes: 5
Reputation: 41
Open your project in gcloud
Go to "APIs & Services"
Go to "Credentials".
Click "Create new client ID" or go to Service account if already created.
Select "Service Account".
Go to "Keys" and select "Create new key" from "ADD KEY" drop down
Select JSON or P12 as needed
Upvotes: 4
Reputation: 2457
Update (2013-12-18): Google updated the Cloud Console this morning. The new instructions for generating a private key are:
Obsolete instructions (prior to 2013-12-18): Here is how to generate a private key in the Google Cloud Console:
The URL in the JSON instead takes you to a public URL where the public key for corresponding private key can be found - that's not what you are looking for.
Upvotes: 17