Tl;dr:
Trying to create an AuthCode following the Url example of settings/services/org.openhab.voice.googletts
google gives me an Error page 400: redirect_uri_mismatch
instead of an AuthCode
This is openHAB 3.3.0.M6 running on debian buster
I had set up google tts in september 2021 and it had worked nicely for me since then. Yesterday it stopped in mid-talk, between one SAY and the other it stopped working.
First was:
Error initializing Google Cloud TTS service: An unexpected IOException occurred: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Buffering capacity 2097152 exceeded
and after that any attempt to say made a log line: Missing service configuration.
After a while there was an addition to that: Error fetching access token. Invalid authcode? Please generate a new one.
I went on the UI page, copied, edited the url for the authCode generation. Those were of the redirect_uri=urn:ietf:wg:oauth:2.0:oob
kind, Google would give me an AuthCode but as soon as I put that into the form the log signaled failure:
2022-06-16 15:14:11.849 [ERROR] [oauth2client.internal.OAuthConnector] - grant type authorization_code to URL https://accounts.google.com/o/oauth2/token failed with error code redirect_uri_mismatch, description Bad Request
2022-06-16 15:14:11.858 [WARN ] [ce.googletts.internal.GoogleCloudAPI] - Error initializing Google Cloud TTS service: Error fetching access token. Invalid authcode? Please generate a new one.
I set TRACE on:
openhab> log:set TRACE org.openhab.voice.googletts openhab> log:set TRACE org.openhab.core.auth.oauth2client
and then entred a new AuthCode into the form. The log reported:
2022-06-16 16:41:17.349 [DEBUG] [.googletts.internal.GoogleTTSService] - Updating configuration
2022-06-16 16:41:17.351 [TRACE] [.googletts.internal.GoogleTTSService] - New configuration: GoogleTTSConfig{pitch=0.0, speakingRate=1.0, volumeGainDb=0.0, purgeCache=false}
2022-06-16 16:41:17.352 [DEBUG] [ce.googletts.internal.GoogleCloudAPI] - Trying to get access and refresh tokens.
2022-06-16 16:41:17.369 [DEBUG] [oauth2client.internal.OAuthConnector] - Oauth request parameter grant_type, value authorization_code
2022-06-16 16:41:17.370 [DEBUG] [oauth2client.internal.OAuthConnector] - Oauth request parameter code, value 4/1AX4XfWgGm9_blablablap2gyM315R6znIAE5Nl78TFjv_50TLkuW0g
2022-06-16 16:41:17.372 [DEBUG] [oauth2client.internal.OAuthConnector] - Oauth request parameter redirect_uri, value https://www.google.com
2022-06-16 16:41:17.373 [DEBUG] [oauth2client.internal.OAuthConnector] - Setting authentication for clientId 537129798020-blablabla1o1kii7bqav309.apps.googleusercontent.com. Using basic auth false
2022-06-16 16:41:17.602 [ERROR] [oauth2client.internal.OAuthConnector] - grant type authorization_code to URL https://accounts.google.com/o/oauth2/token failed with error code invalid_grant, description Bad Request
2022-06-16 16:41:17.608 [DEBUG] [ce.googletts.internal.GoogleCloudAPI] - Error fetching access token: null
When I noticed that redirect_uri was completly different than what the UI gave me I decided to try an update and indeed there was a new oh milestone to install.
Unfortunately, while I see a change it still doesn’t work. there is a different value for the redirect_uri parameter, https://www.google.com.
Following the UI’s example I can open a new tab but instead of a login screen and finally the Authcode I get an error message Error 400: redirect_uri_mismatch
I searched the google cloud console, created an additional client, later created a new project to follow the docu step by step. No change whatever I tried.
Is there a place where I would need to enter the redirect uri so it can be matched successfully?
After hours of trying I feel lost. Thanks for any input