Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.config_entry_oauth2_flow.AbstractOAuth2Implementation Class Reference
Inheritance diagram for homeassistant.helpers.config_entry_oauth2_flow.AbstractOAuth2Implementation:
[legend]
Collaboration diagram for homeassistant.helpers.config_entry_oauth2_flow.AbstractOAuth2Implementation:
[legend]

Public Member Functions

str async_generate_authorize_url (self, str flow_id)
 
dict async_refresh_token (self, dict token)
 
dict async_resolve_external_data (self, Any external_data)
 
str domain (self)
 
str name (self)
 

Private Member Functions

dict _async_refresh_token (self, dict token)
 

Detailed Description

Base class to abstract OAuth2 authentication.

Definition at line 58 of file config_entry_oauth2_flow.py.

Member Function Documentation

◆ _async_refresh_token()

dict homeassistant.helpers.config_entry_oauth2_flow.AbstractOAuth2Implementation._async_refresh_token (   self,
dict  token 
)
private

◆ async_generate_authorize_url()

str homeassistant.helpers.config_entry_oauth2_flow.AbstractOAuth2Implementation.async_generate_authorize_url (   self,
str  flow_id 
)
Generate a url for the user to authorize.

This step is called when a config flow is initialized. It should redirect the
user to the vendor website where they can authorize Home Assistant.

The implementation is responsible to get notified when the user is authorized
and pass this to the specified config flow. Do as little work as possible once
notified. You can do the work inside async_resolve_external_data. This will
give the best UX.

Pass external data in with:

await hass.config_entries.flow.async_configure(
    flow_id=flow_id, user_input={'code': 'abcd', 'state': … }

)

Reimplemented in homeassistant.helpers.config_entry_oauth2_flow.LocalOAuth2Implementation.

Definition at line 72 of file config_entry_oauth2_flow.py.

◆ async_refresh_token()

dict homeassistant.helpers.config_entry_oauth2_flow.AbstractOAuth2Implementation.async_refresh_token (   self,
dict  token 
)
Refresh a token and update expires info.

Definition at line 101 of file config_entry_oauth2_flow.py.

◆ async_resolve_external_data()

dict homeassistant.helpers.config_entry_oauth2_flow.AbstractOAuth2Implementation.async_resolve_external_data (   self,
Any  external_data 
)
Resolve external data to tokens.

Turn the data that the implementation passed to the config flow as external
step data into tokens. These tokens will be stored as 'token' in the
config entry data.

Reimplemented in homeassistant.helpers.config_entry_oauth2_flow.LocalOAuth2Implementation.

Definition at line 93 of file config_entry_oauth2_flow.py.

◆ domain()

str homeassistant.helpers.config_entry_oauth2_flow.AbstractOAuth2Implementation.domain (   self)
Domain that is providing the implementation.

Reimplemented in homeassistant.helpers.config_entry_oauth2_flow.LocalOAuth2Implementation.

Definition at line 68 of file config_entry_oauth2_flow.py.

◆ name()

str homeassistant.helpers.config_entry_oauth2_flow.AbstractOAuth2Implementation.name (   self)

The documentation for this class was generated from the following file: