OAuth fails on the device

Hello,

I am writing an app that supports OAuth authentication to my website.

Everything is in place and works fine in the simulator. I can get a code and then exchange it for a token without issue.

I decided to try it on my watch (Fenix 5) but it fails there : the OAuth callback is called but with a responseCode of zero and no data.

I even tested my server in Google OAuth 2.0 playground (https://developers.google.com/oauthplayground) and everything is working fine there.

I checked the log on the server and everything seems to be fine : the OAuth code is sent back but then it seems like Connect IQ is struggling (progress bar does not move) and then the callback is called with zero.

I am really struggling so as to know what is happening...

I am using https://localhost as the redirect Uri as seen in all examples over the web.

Thanks for any help on this!
Nicolas


  • What certificate are you using with your server? I do not believe that the watches like self signed certificates so you need to have a real signed certificate rather than one you have created yourself. Did you check other https traffic works? I know a number of us use letsencrypt.org certificates without trouble. Generally I'd expect an error to be returned rather than success with no data so not sure that this is your problem, but thought this was worth pointing out just in case. Personally, I have not tried OAuth.
  • I am also using a letsencrypt certificate. The process goes smoothly until code is returned : Connect IQ notifies my app needs to connect, auth process goes will until the code is sent back to Connect IQ. Looks like it does not reach my app though...
  • Oddly enough seems that I wanted to over-check the results. While the responseCode is 0, in fact the code (and later token) are available in the server response...

    I was checking that the responseCode was 200 before processing the data but this is more than overkilled!

    NIcolas