Using gcloud alpha services It's now perfectly possible to generate keys programatically:
gcloud alpha services api-keys create
I can then enable the Maps JavaScript API using
gcloud services enable maps-backend.googleapis.com
At this point I need to set some HTTP referrer restrictions on that key but the services api-keys update command only updates an API key's metadata.
How do I proceed?
It looks (haven't tried the API) as though you can do this at create and update with --allowed-referrers:
https://cloud.google.com/sdk/gcloud/reference/alpha/services/api-keys/create
https://cloud.google.com/sdk/gcloud/reference/alpha/services/api-keys/update
Related
I'm new to this and I need some help with Google Cloud.
Basically, I was trying to create a project which uses many different CF and even works with DialogFlow CX.
The problem is that if I try to use a Gen 2 CF it gives me authentication problems if I set it 'Private'.
Is it possible to use the CF without setting that public or using a Gen 1 CF?🙏🏻
You can find good references at the Securing Cloud Functions documentation.
Basically, the default deployment is private which will require some sort of authentication (user account based or service account based -- more details on the doc aforementioned).
So, if I understood the scenario correctly, you just need to properly setup the authentication configuration and then your scenario of Dialogflow interacting with a Google Cloud Function service will work as expected.
I need to retrieve a list of all users present in my Oracle Cloud environment via REST API or Go SDK.
Looking at the REST API docs, the Go SDK docs, and the OCI CLI docs, nowhere seems to provide an option to supply Identity Domain as an argument.
oci iam user list returns only the set of users present in the "Default" domain, even when I authenticate as a user in another domain.
Is there a way to fetch users from other Identity Domains?
Here is the REST API doc to list all users in the identity domain:
https://docs.oracle.com/en/cloud/paas/iam-domains-rest-api/op-admin-v1-users-get.html
Also, please use the domain URL for the API endpoint? Something like this: https://{domainUrl}/admin/v1/Users).
Unfortunately, we have Go SDK (or other SDKs and CLI) support only for IAM resources but not for Identity Domains (IDCS).
Thanks.
i am trying to create a DialogFlow CX agent and call webhook Cloud function. The primary criteria for authentication is to use the service account. I expected this to be created automatically as per the docs mentioned here but I just cant see it in my IAM list.
Is this a bug or am i looking at something else?
Services accounts are created only when needed. If you proceed to add the webhook to the cloud Function, test it and then go to the IAM & Admin page you should be able to see it. Please, remember to mark the Include Google-provided role grants checkbox to be able to see it. If it is not created you can always manually do it as it shows in the documentation that you linked with the command:
gcloud beta services identity create --service=dialogflow.googleapis.com --project=agent-project-id
i tried to set up a simple map: http://pan-american.ch and keep getting the same error in the JS Console:
https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
Your site URL to be authorized:
on this Domain http://map2.codedesign.ch the key works fine.
so my question is - where can i add Domains...
You want to setup the referrers to allow http://pan-american.ch.
See the Google Documentation on Setting up API keys:
Setting up API keys
If your client application does not use OAuth 2.0, then it must include an API key when it calls an API that's enabled within a Google Cloud Platform project. The application passes this key into all API requests as a key=API_key parameter.
To create your application's API key:
Go to the Cloud Platform Console.
From the projects list, select a project or create a new one.
If the API Manager page isn't already open, open the menu Gallery Menu and select API Manager.
On the left, choose Credentials.
Click Create credentials and then select API key.
Choose the type of key to use. (API key types are described in more detail in the following sections.) If you're unsure whether an API key is appropriate for the API you're calling, select Help me choose and follow the instructions to pick the right credentials.
Note: In addition to reading the instructions on this page, be sure to read Best practices for securely using API keys.
The API supports several types of API keys, including server keys, browser keys, iOS keys, and Android keys.
Browser keys
Create and use a Browser key if your application runs on a client, such as a web browser. To prevent your key from being used on unauthorized sites, only allow referrals from domains you administer.
I'm developing my application using Laravel Homestead virtual server. Of course I've rewrite my site from http://192.168.0... to http://myaplication.app. Then I need to create a Google Api key to implement Google maps on my project but I can not generate my api key.
This is how I am doing that:
But Google throws me an error telling me the application is not authorized. Can someone help me?
This is because Google need a regular domain like app.com for "URIS de redireccionamiento". Google doesn't allow local Ip's (e.g. 192.168...).
The solution is simple, because you are in development you have to add http://localhost in Javacript origins and leave blank other form fields where Google asks for ips or URls.