Skip to content

Commit

Permalink
fix: tunnistus related settings
Browse files Browse the repository at this point in the history
HELSINKI_PROFILE_SCOPE must be set to access_token in tunnistus

OIDC_RP_SCOPES must not include the profile scope in tunnistus

OIDC_RP_SCOPES should include email in tunnistus so that the token has
email information for django-helusers.

refs: TETP-310, TETP-314
  • Loading branch information
voneiden committed Feb 27, 2025
1 parent 8cd2c2f commit 39b362a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/tet/tet/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
LINKEDEVENTS_TIMEOUT=(int, 20),
GDPR_API_QUERY_SCOPE=(str, "gdprquery"),
GDPR_API_DELETE_SCOPE=(str, "gdprdelete"),
HELSINKI_PROFILE_SCOPE=(str, "access_token"),
)

if os.path.exists(env_file):
Expand Down Expand Up @@ -280,8 +281,8 @@
OIDC_AUTH = {"OIDC_LEEWAY": django_env.int("OIDC_LEEWAY")}

OIDC_RP_SIGN_ALGO = "RS256"
HELSINKI_PROFILE_SCOPE = "https://api.hel.fi/auth/helsinkiprofile"
OIDC_RP_SCOPES = f"openid profile {HELSINKI_PROFILE_SCOPE}"
HELSINKI_PROFILE_SCOPE = django_env("HELSINKI_PROFILE_SCOPE")
OIDC_RP_SCOPES = "openid profile email"

OIDC_RP_CLIENT_ID = django_env.str("OIDC_RP_CLIENT_ID")
OIDC_RP_CLIENT_SECRET = django_env.str("OIDC_RP_CLIENT_SECRET")
Expand Down

0 comments on commit 39b362a

Please sign in to comment.