Hi,
I'm trying to get a Google OAuth flow up and running in my ConnectIQ app.
However I seem to be bumping into an endless chain of issues.
Apparently, the Linux simulator can't talk over the network, which seems to be a known issue according to some posts I came across.
Ok, I temporarily moved to Windows while developing this part of the app...
Now here I always get a 500 response code, and no data in the callback arg dictionary.
I do get the consent window pop-up and the callback does get called.
I even fired up my own http echo server on localhost to confirm that the redirect from google's OAuth is fine.
And it is. The auth code is there. However the simulator doesn't intercept the request somehow (as I guess it should).
I've taken down any firewall, if that matters.
Tried both http and https, localhost and 127.0.0.1, no success...
Eventually I took the app to the watch (fenix 5X) and bumped into this issue:
https://forums.garmin.com/forum/developers/connect-iq/connect-iq-bug-reports/157486-
Which is a different story (makeOAuthRequest - Google SignIn - disallowed_useragent).
Now, until this gets fixed (or until I get a workaround for it from the Garmin support),
I'd like to be able to continue developing & debugging on the simulator.
I believe I could write a companion app just to replicate the GCM OAuth functionality,
but I think that would be a really really ugly and time consuming workaround,
although I might have already consumed more time fiddling with all the problems I've outlined in this post.
It's been a few nights since I've been fighting this, so I thought it was time to reach out to you guys.
Thanks in advance,
Alex
To isolate this issue from the rest of my app, I replaced the makeWebRequest() call in the SDK WebRequest example with something like this:
function getOAuthToken() {
var params = {
"scope" => Comm.encodeURL("www.googleapis.com/.../spreadsheets"),
"redirect_uri" => "https://localhost",
"response_type" => "code",
"client_id" => "<MY CLIENT ID HERE>"
};
Comm.makeOAuthRequest(
"accounts.google.com/.../auth",
params,
"https://localhost",
Comm.OAUTH_RESULT_TYPE_URL,
{"code" => "access_code"}
);
}
function oAuthCallback(arg) {
System.println("data: " + arg.data); // empty dictionary...
System.println("responseCode: " + arg.responseCode); // this is always 500; actually I got it to be 400 by intentionally breaking the redirect address (just to make sure that 500 isn't hard-wired somehow :)
}