diff --git a/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx b/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx index c5df74206d..9d376af482 100644 --- a/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx +++ b/frontend/src/component/admin/auth/OidcAuth/OidcAuth.tsx @@ -23,6 +23,7 @@ import { SsoGroupSettings } from '../SsoGroupSettings'; const initialState = { enabled: false, enableSingleSignOut: false, + addGroupsScope: false, enableGroupSyncing: false, autoCreate: false, unleashHostname: location.hostname, diff --git a/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx b/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx index da4eb30227..c9a0a07f86 100644 --- a/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx +++ b/frontend/src/component/admin/auth/SamlAuth/SamlAuth.tsx @@ -20,6 +20,7 @@ const initialState = { enabled: false, autoCreate: false, enableGroupSyncing: false, + addGroupsScope: false, unleashHostname: location.hostname, entityId: '', signOnUrl: '', diff --git a/frontend/src/component/admin/auth/SsoGroupSettings.tsx b/frontend/src/component/admin/auth/SsoGroupSettings.tsx index e68ae4d0fb..972e46b4fe 100644 --- a/frontend/src/component/admin/auth/SsoGroupSettings.tsx +++ b/frontend/src/component/admin/auth/SsoGroupSettings.tsx @@ -1,5 +1,6 @@ import React, { Fragment } from 'react'; import { FormControlLabel, Grid, Switch, TextField } from '@mui/material'; +import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; interface SsoGroupSettingsProps { ssoType: 'OIDC' | 'SAML'; @@ -7,6 +8,7 @@ interface SsoGroupSettingsProps { enabled: boolean; enableGroupSyncing: boolean; groupJsonPath: string; + addGroupsScope: boolean; }; setValue: (name: string, value: string | boolean) => void; } @@ -17,6 +19,7 @@ export const SsoGroupSettings = ({ enabled: false, enableGroupSyncing: false, groupJsonPath: '', + addGroupsScope: false, }, setValue, }: SsoGroupSettingsProps) => { @@ -28,6 +31,9 @@ export const SsoGroupSettings = ({ setValue(event.target.name, event.target.value); }; + const updateAddGroupScope = () => { + setValue('addGroupsScope', !data.addGroupsScope); + }; return ( <> @@ -76,6 +82,36 @@ export const SsoGroupSettings = ({ /> + + + Request 'groups' Scope +

+ When enabled Unleash will also request the + 'groups' scope as part of the login request. +

+
+ + + } + label={ + data.addGroupsScope ? 'Enabled' : 'Disabled' + } + /> + + + } + /> ); };