Home Assistant Unofficial Reference 2024.12.1
homeassistant.auth.providers.AuthProvider Class Reference
Collaboration diagram for homeassistant.auth.providers.AuthProvider:
[legend]

Public Member Functions

None __init__ (self, HomeAssistant hass, AuthStore store, dict[str, Any] config)
 
Credentials async_create_credentials (self, dict[str, str] data)
 
list[Credentialsasync_credentials (self)
 
Credentials async_get_or_create_credentials (self, Mapping[str, str] flow_result)
 
None async_initialize (self)
 
LoginFlow async_login_flow (self, AuthFlowContext|None context)
 
UserMeta async_user_meta_for_credentials (self, Credentials credentials)
 
None async_validate_refresh_token (self, RefreshToken refresh_token, str|None remote_ip=None)
 
str|None id (self)
 
str name (self)
 
bool support_mfa (self)
 
str type (self)
 

Public Attributes

 config
 
 hass
 
 store
 

Static Public Attributes

string DEFAULT_TITLE = "Unnamed auth provider"
 

Detailed Description

Provider of user authentication.

Definition at line 50 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.auth.providers.AuthProvider.__init__ (   self,
HomeAssistant  hass,
AuthStore  store,
dict[str, Any]   config 
)
Initialize an auth provider.

Definition at line 55 of file __init__.py.

Member Function Documentation

◆ async_create_credentials()

Credentials homeassistant.auth.providers.AuthProvider.async_create_credentials (   self,
dict[str, str]  data 
)
Create credentials.

Definition at line 100 of file __init__.py.

◆ async_credentials()

list[Credentials] homeassistant.auth.providers.AuthProvider.async_credentials (   self)
Return all credentials of this provider.

Definition at line 86 of file __init__.py.

◆ async_get_or_create_credentials()

Credentials homeassistant.auth.providers.AuthProvider.async_get_or_create_credentials (   self,
Mapping[str, str]   flow_result 
)
Get credentials based on the flow result.

Definition at line 115 of file __init__.py.

◆ async_initialize()

None homeassistant.auth.providers.AuthProvider.async_initialize (   self)
Initialize the auth provider.

Definition at line 130 of file __init__.py.

◆ async_login_flow()

LoginFlow homeassistant.auth.providers.AuthProvider.async_login_flow (   self,
AuthFlowContext | None  context 
)
Return the data flow for logging in with auth provider.

Auth provider should extend LoginFlow and return an instance.

Definition at line 108 of file __init__.py.

◆ async_user_meta_for_credentials()

UserMeta homeassistant.auth.providers.AuthProvider.async_user_meta_for_credentials (   self,
Credentials   credentials 
)
Return extra user metadata for credentials.

Will be used to populate info when creating a new user.

Definition at line 121 of file __init__.py.

◆ async_validate_refresh_token()

None homeassistant.auth.providers.AuthProvider.async_validate_refresh_token (   self,
RefreshToken  refresh_token,
str | None   remote_ip = None 
)
Verify a refresh token is still valid.

Optional hook for an auth provider to verify validity of a refresh token.
Should raise InvalidAuthError on errors.

Definition at line 134 of file __init__.py.

◆ id()

str | None homeassistant.auth.providers.AuthProvider.id (   self)
Return id of the auth provider.

Optional, can be None.

Definition at line 64 of file __init__.py.

◆ name()

str homeassistant.auth.providers.AuthProvider.name (   self)
Return the name of the auth provider.

Definition at line 77 of file __init__.py.

◆ support_mfa()

bool homeassistant.auth.providers.AuthProvider.support_mfa (   self)
Return whether multi-factor auth supported by the auth provider.

Definition at line 82 of file __init__.py.

◆ type()

str homeassistant.auth.providers.AuthProvider.type (   self)
Return type of the provider.

Definition at line 72 of file __init__.py.

Member Data Documentation

◆ config

homeassistant.auth.providers.AuthProvider.config

Definition at line 61 of file __init__.py.

◆ DEFAULT_TITLE

string homeassistant.auth.providers.AuthProvider.DEFAULT_TITLE = "Unnamed auth provider"
static

Definition at line 53 of file __init__.py.

◆ hass

homeassistant.auth.providers.AuthProvider.hass
Initialize an auth provider.

Definition at line 59 of file __init__.py.

◆ store

homeassistant.auth.providers.AuthProvider.store

Definition at line 60 of file __init__.py.


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