Search code examples
c#google-cloud-platformapi-keygoogle-cloud-translate

How to use Google Cloud Translation V3 with API KEY in C# client library?


I want to use Google Translation V3 with C# client lib google provides. but what I can find all is using service account to authenticate.

I prefer to use API key as an authentication method instead of service account since I'll build this app to user's mobile and I don't want user to have my service account file.

but In google's official document I can only find the example to authenticated by service account.

so how can I use API key with C# lib to authenticated and use Google Cloud Translation?


Solution

  • You cannot use an API Key.

    You will need to design a service that authorizes your users and your service will make translation requests on their behalf using a service account. You could also issue short-lived access tokens using your service account and then the client can make API requests using that access token.

    Note: API Keys are now legacy and most Google Cloud services no longer support API Keys.