Add feature toggle to disable groups scope (#39)

* Update README.md

Ad two to dos:
- bool for scopes
- "groups" scope configurable

* Update README.md

- Add scope bool to configuration options

* Final Update for making scope "groups" optinal

README:
Add scope bool to configuration options
Add two to dos:

bool for scopes
"groups" scope configurable

config:
Make scope "groups" a feature which can be deactivated

init:
Make the feature for the groups bool working in the scope variable

* Remove double description

* Update config.py
This commit is contained in:
Tom Kölsch
2025-02-14 19:03:14 +01:00
committed by GitHub
parent b39a65ff74
commit 29a2545396
3 changed files with 13 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ from .config import (
CLAIMS,
ROLES,
NETWORK,
FEATURES_INCLUDE_GROUPS_SCOPE,
)
# pylint: enable=useless-import-alias
@@ -53,7 +54,10 @@ async def async_setup(hass: HomeAssistant, config):
_LOGGER.info("Registered OIDC provider")
# We only use openid, profile & groups, never email
scope = "openid profile groups"
include_groups_scope = my_config[FEATURES].get(FEATURES_INCLUDE_GROUPS_SCOPE, True)
scope = "openid profile"
if include_groups_scope:
scope += " groups"
oidc_client = oidc_client = OIDCClient(
hass=hass,