Integrating Community with Google Translate
Hi
We are exploring integrating google translate into our community. So, I had a couple of questions.
Google uses Oauth 2.0 as detailed here https://developers.google.com/identity/protocols/oauth2/service-account#httprest which I am completely unfamiliar with. So, I have been slowly working my way through these instructions to request the access token from google.
I'm up to generating the signature which google says requires RSA SHA256 algorithm. In the Khoros documentation I found this digest.hmac("algorithm","key","message") (khoros.com) and it looks like I can use HMAC SHA256. Again, all of this is Greek to me 😀 but a little searching tells me HMAC and RSA are two different things.
So, does anyone know if RSA is possible with Khoros? I can't find anything about it in the documentation.
Also, has anyone else done this kind of integration specifically with google translate? If so, can you share how to do this authentication?
Thanks!
I had a look at the docs you linked for Google and it indeed seems overly complicated. I mean an endpoint that does send something to a payed service doesn't need OAuth in my opinion, it just needs a valid API key to associate the request with your account, there is no "identity element" involved to distinguish between various users, that's what OAuth is usually used for in my world... e.g. I'm not seeing the point in going trough all the OAuth hoops for something relatively simple like that...
but:
but of course I don't know if you intend to use the Advanced API (v3)? Otherwise you might be able to get around with a regular API key / Bearer token auth, here's how you'd do it: https://stackoverflow.com/a/70656679/4428236
If you don't want to bother at all with authentication you could try and get inspired by this https://github.com/Stichoza/google-translate-php/blob/master/src/GoogleTranslate.php , it basically "abuses" translate.google.com (the web version) to translate stuff for free 😉.