Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Demo: use access_token instead of service account #397

Closed
1c7 opened this issue Dec 2, 2019 · 3 comments
Closed

Demo: use access_token instead of service account #397

1c7 opened this issue Dec 2, 2019 · 3 comments
Assignees
Labels
api: translation Issues related to the nodejs-translate API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@1c7
Copy link

1c7 commented Dec 2, 2019

image

Image above is the only example

Please add one more example

Demo how to use access_token for Google Translate API
(access_token come from OAuth, I already got this part done, I am translate on users behalf. so the app cost user money instead of mine)

(I am building an Electron desktop app that use Google Translate. the OAuth part is done. now I just need to know what to do with the access_token)

Thank you

@stephenplusplus
Copy link
Contributor

Hello! Unfortunately, the authentication library we are using does not support passing an access_token directly. We have an issue tracking that feature request here: googleapis/google-auth-library-nodejs#677. Please subscribe to that issue for updates.

@stephenplusplus stephenplusplus added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Dec 2, 2019
@1c7
Copy link
Author

1c7 commented Dec 2, 2019

@stephenplusplus Thanks 😄

@1c7
Copy link
Author

1c7 commented Dec 2, 2019

By the way, For other people who also got the same problem.
if you want to use OAuth access_token for Google Translation API.
For now, You can just send HTTP request in this format:

image
This screenshot come from this document:
https://cloud.google.com/translate/docs/basic/setup-basic

@google-cloud-label-sync google-cloud-label-sync bot added the api: translation Issues related to the nodejs-translate API. label Jan 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: translation Issues related to the nodejs-translate API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants