CloudOAuth2Callback
homey.cloud_oauth2_callback
An OAuth2 callback that can be used in log-in flows.
This class must not be initialized by the developer,
but retrieved by calling ManagerCloud.create_oauth2_callback().
Ancestors
- SimpleClass
- homey.util.event_emitter.EventEmitter
- typing.Generic
Methods
on_url
def on_url(self, f: Callable[[str], None]) ‑> SelfThe url event is fired when a URL is received.
The user must be redirected to this URL to complete the sign-in process.
Args
| Name | Type | Description |
|---|---|---|
f |
Callable[[str], None] | Callback that receives an absolute URL to the sign-in page. |
on_code
def on_code(self, f: Callable[[str | Exception], None]) ‑> SelfThe code event is fired when an OAuth2 code is received.
The code can usually be swapped by the app for an access token.
Args
| Name | Type | Description |
|---|---|---|
f |
Callable[[str | Exception], None] | Callback that receives an OAuth2 code, or an Exception if something went wrong. |