How to make oAuth request in simulator?

I implemented an oAuth process for a widget. That works fine on the watch and oAuth is provides by ConnectApp.

But I don't get the oAuth process to work on the PC/simulator.

The oAuth popup is shown, but teh content is not loaded correctly.

It should look like this browser version (Firefox):


So I tried to open the URL in the browser. After auth process, the code is passed back to "localhost" as callback (like it's used on the watch that ConnectApp gets back the code).
But this ends up with a error "no connection to localhost".

How can I pass back the auth code to the simulator? Isn't it running a webserver to accept the callback?


Edit: What browser is used to show the oAuth popup? The url is loading a page and this page is dynamically loading the auth form. And that's not done. It seems JS is deactivated in this window.Can I change the used browser or actiate JS?

Edit2: In the past I used a workaround for this:
- open the oiAuth page in Firefox, login and copy the result code
- paste the auth code into the code, run the app once to get the refresh/bearer token
- delete the auth code in the app code and run the app again. Not it uses the stored bearer/refresh token to login.
But this is not working with the new SDKs (4.2.2) because build and app start takes much longer until the simulator is shown. In this time, the auth code is invalid.

Top Replies

All Replies