ioBroker.admin icon indicating copy to clipboard operation
ioBroker.admin copied to clipboard

Create a generic way to accept "OAuth Callbacks/Redirects" on Admin and send info to adapter

Open Apollon77 opened this issue 3 years ago • 2 comments
trafficstars

The idea is that an OAuth flow started via Admin config UI can also end in Admin. We already have a webserver here listening and reachable by the local browser.

Create a route on admin like /oauth2_callbacks/adaptername.instance/ and if this route is called, e.g. http://localhost:8081/oauth2_callbacks/netatmo.0/?state=21hPXNoA5EhibbRP2KOeS16IToEgKlcgUFHxI0vf&code=d507d605a5e44c1f2db579c2177d77d9".

  • extract the adapterinstance
  • send a message to this instance with command like "OAuthCallbackReceivedByAdmin" containing the Redirect URL as content
  • depending on the resllt of the message show (nicely formatted):
    • if an error is return show it as error
    • if a success message is returned show it as success message
    • if a timeout occurs (e.g. callback not answered within 10s or such) show a Timeout error message

The shown page should also contain a close button which tries to close the page

Apollon77 avatar Jul 27 '22 12:07 Apollon77

@Apollon77 Can you please check with current admin version if this issue is fixed?

Feuer-sturm avatar Aug 01 '22 17:08 Feuer-sturm

Yes, planned for today

Apollon77 avatar Aug 02 '22 07:08 Apollon77