Example code to connect to philips hue or other webservice

Hi,

Since days I struggle connect for example to philips hue or smartcar service.

The flow as i understand is that the watch calls the mobile phone app and opens service website for logon. There you logon with service credentials and get back a token

 However I only get so far that on the mobile phone it shows the succesfull connect to the service but than nothing happens and the result URL is not fetched by the connect app

Any code example available or git example program?

Would really appreciate as I'm struggeling for days.

Thanks