Add Additional Scopes to Maximize Functionality from Custom idP (#80)

* add additional scopes to config schema

Keep original groups setting for backwards compatibility.

* fix weird text issue

* Add support for additional scopes in OIDC setup

* fix compile error

* Update documentation to include description of additional oidc scopes

* clarify documentation
This commit is contained in:
Seth
2025-07-09 02:55:37 -05:00
committed by GitHub
parent cb4d72a148
commit b4d5d7f2bf
3 changed files with 13 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ from .config import (
DISPLAY_NAME,
ID_TOKEN_SIGNING_ALGORITHM,
GROUPS_SCOPE,
ADDITIONAL_SCOPES,
FEATURES,
CLAIMS,
ROLES,
@@ -66,6 +67,13 @@ async def async_setup(hass: HomeAssistant, config):
groups_scope = my_config.get(GROUPS_SCOPE, "groups")
if include_groups_scope:
scope += " " + groups_scope
# Add additional scopes if configured
additional_scopes = my_config.get(ADDITIONAL_SCOPES, [])
if additional_scopes:
# Ensure we have a space before adding additional scopes
if scope:
scope += " "
scope += " ".join(additional_scopes)
# Create the OIDC client
oidc_client = oidc_client = OIDCClient(