@@ -50,6 +50,7 @@ import { actions as routeActions } from "../store/route";
50
50
import { actions as userActions } from "../store/user" ;
51
51
import { useOidc } from "@axa-fr/react-oidc" ;
52
52
import { getConfig } from "../config" ;
53
+ import { Link } from "react-router-dom" ;
53
54
54
55
const { Title, Paragraph, Text } = Typography ;
55
56
@@ -76,6 +77,7 @@ export const Settings = () => {
76
77
] ;
77
78
78
79
const [ groupsClicked , setGroupsClicked ] = useState ( false ) ;
80
+ const [ idpCLicked , setIdpClicked ] = useState ( false ) ;
79
81
const [ billingClicked , setBillingClicked ] = useState ( false ) ;
80
82
const [ authClicked , setAuthClicked ] = useState ( true ) ;
81
83
const [ dangerClicked , setDangerClicked ] = useState ( false ) ;
@@ -657,24 +659,35 @@ export const Settings = () => {
657
659
setGroupsClicked ( false ) ;
658
660
setBillingClicked ( false ) ;
659
661
setDangerClicked ( false ) ;
662
+ setIdpClicked ( false ) ;
660
663
break ;
661
664
case "groups" :
662
665
setGroupsClicked ( true ) ;
663
666
setBillingClicked ( false ) ;
664
667
setAuthClicked ( false ) ;
665
668
setDangerClicked ( false ) ;
669
+ setIdpClicked ( false ) ;
666
670
break ;
667
671
case "billing" :
668
672
setBillingClicked ( true ) ;
669
673
setAuthClicked ( false ) ;
670
674
setGroupsClicked ( false ) ;
671
675
setDangerClicked ( false ) ;
676
+ setIdpClicked ( false ) ;
672
677
break ;
673
678
case "danger" :
674
679
setBillingClicked ( false ) ;
675
680
setAuthClicked ( false ) ;
676
681
setGroupsClicked ( false ) ;
677
682
setDangerClicked ( true ) ;
683
+ setIdpClicked ( false ) ;
684
+ break ;
685
+ case "idp" :
686
+ setIdpClicked ( true ) ;
687
+ setBillingClicked ( false ) ;
688
+ setAuthClicked ( false ) ;
689
+ setGroupsClicked ( false ) ;
690
+ setDangerClicked ( false ) ;
678
691
break ;
679
692
}
680
693
} ;
@@ -702,12 +715,12 @@ export const Settings = () => {
702
715
"System settings" ,
703
716
"sub2" ,
704
717
< SettingOutlined /> ,
705
- [ getItem ( "Authentication" , "auth" ) , getItem ( "Groups" , "groups" ) , getItem ( "Danger zone" , "danger" , undefined , undefined , undefined , ! isOwner ) ] ,
718
+ [ getItem ( "Authentication" , "auth" ) , getItem ( "Groups" , "groups" ) , getItem ( "Identity provider" , "idp" , undefined , undefined , undefined , ! ( isNetBirdHosted ( ) || isLocalDev ( ) ) ) , getItem ( " Danger zone", "danger" , undefined , undefined , undefined , ! isOwner ) ] ,
706
719
"group"
707
720
) ,
708
721
] ;
709
722
710
- useEffect ( ( ) => { } , [ groupsClicked , billingClicked , authClicked , dangerClicked ] ) ;
723
+ useEffect ( ( ) => { } , [ groupsClicked , billingClicked , authClicked , dangerClicked , idpCLicked ] ) ;
711
724
const renderGroupsSettingForm = ( ) => {
712
725
return (
713
726
< >
@@ -1034,9 +1047,10 @@ export const Settings = () => {
1034
1047
/>
1035
1048
</ Form . Item >
1036
1049
</ div >
1050
+
1037
1051
< Col
1038
1052
span = { 24 }
1039
- style = { { marginTop : "10px" , marginBottom : "24px" } }
1053
+ style = { { marginTop : "- 10px" , marginBottom : "24px" } }
1040
1054
>
1041
1055
< Text type = { "secondary" } >
1042
1056
Learn more about
@@ -1050,6 +1064,125 @@ export const Settings = () => {
1050
1064
</ a >
1051
1065
</ Text >
1052
1066
</ Col >
1067
+ { ( isNetBirdHosted ( ) || isLocalDev ( ) ) && (
1068
+ < Col span = { 24 }
1069
+ style = { { marginTop : "10px" , marginBottom : "24px" } } >
1070
+ < label
1071
+ style = { {
1072
+ color : "rgba(0, 0, 0, 0.88)" ,
1073
+ fontSize : "14px" ,
1074
+ fontWeight : "500" ,
1075
+ } }
1076
+ >
1077
+ Multi-factor authentication (MFA)
1078
+ </ label >
1079
+ < Paragraph
1080
+ type = { "secondary" }
1081
+ style = { {
1082
+ marginTop : "-2" ,
1083
+ fontWeight : "400" ,
1084
+ marginBottom : "5px" ,
1085
+ } }
1086
+ >
1087
+ < Text type = { "secondary" } >
1088
+ If your IdP supports MFA, it will work automatically with NetBird. Otherwise, contact us at
1089
+ < a
1090
+ target = "_blank"
1091
+ rel = "noreferrer"
1092
+
1093
+ >
1094
+ { " " }
1095
+
1096
+ { " " }
1097
+ </ a >
1098
+ to enable this feature
1099
+ </ Text >
1100
+ </ Paragraph >
1101
+ </ Col > ) }
1102
+ </ >
1103
+ )
1104
+ }
1105
+
1106
+ const renderIdpSettingsForm = ( ) => {
1107
+ return (
1108
+ < >
1109
+ < div
1110
+ style = { {
1111
+ color : "rgba(0, 0, 0, 0.88)" ,
1112
+ fontWeight : "500" ,
1113
+ fontSize : "18px" ,
1114
+ marginBottom : "20px" ,
1115
+ } }
1116
+ >
1117
+ Identity provider
1118
+ </ div >
1119
+ < div >
1120
+
1121
+ < Row >
1122
+ < Col span = { 24 } >
1123
+ < label
1124
+ style = { {
1125
+ color : "rgba(0, 0, 0, 0.88)" ,
1126
+ fontSize : "14px" ,
1127
+ fontWeight : "500" ,
1128
+ } }
1129
+ >
1130
+ User and group sync
1131
+ </ label >
1132
+ < Paragraph
1133
+ type = { "secondary" }
1134
+ style = { {
1135
+ marginTop : "-2" ,
1136
+ fontWeight : "400" ,
1137
+ marginBottom : "5px" ,
1138
+ } }
1139
+ >
1140
+ Sync users and groups from your IdP to use them in access control
1141
+ </ Paragraph >
1142
+ </ Col >
1143
+ </ Row >
1144
+
1145
+ < Col span = { 24 }
1146
+ style = { { marginTop : "10px" , marginBottom : "24px" } } >
1147
+ < label
1148
+ style = { {
1149
+ color : "rgba(0, 0, 0, 0.88)" ,
1150
+ fontSize : "14px" ,
1151
+ fontWeight : "500" ,
1152
+ } }
1153
+ >
1154
+ Custom IdP
1155
+ </ label >
1156
+ < Paragraph
1157
+ type = { "secondary" }
1158
+ style = { {
1159
+ marginTop : "-2" ,
1160
+ fontWeight : "400" ,
1161
+ marginBottom : "5px" ,
1162
+ } }
1163
+ >
1164
+ Configure your custom IdP like Okta or Jumpcloud
1165
+ </ Paragraph >
1166
+ </ Col >
1167
+
1168
+ < Col
1169
+ span = { 24 }
1170
+ style = { { marginTop : "10px" , marginBottom : "24px" } }
1171
+ >
1172
+ < Text type = { "secondary" } >
1173
+ To enable these features, please contact us at
1174
+ < a
1175
+ target = "_blank"
1176
+ rel = "noreferrer"
1177
+
1178
+ >
1179
+ { " " }
1180
+
1181
+ </ a >
1182
+ </ Text >
1183
+ </ Col >
1184
+ </ div >
1185
+
1053
1186
</ >
1054
1187
)
1055
1188
}
@@ -1125,6 +1258,9 @@ export const Settings = () => {
1125
1258
if ( dangerClicked ) {
1126
1259
loaded = renderDangerSettingsForm ( )
1127
1260
}
1261
+ if ( idpCLicked ) {
1262
+ loaded = renderIdpSettingsForm ( )
1263
+ }
1128
1264
1129
1265
return (
1130
1266
< Form
@@ -1135,7 +1271,7 @@ export const Settings = () => {
1135
1271
>
1136
1272
< Card loading = { loading } defaultValue = { "Enabled" } >
1137
1273
{ loaded }
1138
- { ! dangerClicked && ( < Form . Item style = { { marginBottom : "0" } } >
1274
+ { ! ( dangerClicked || idpCLicked ) && ( < Form . Item style = { { marginBottom : "0" } } >
1139
1275
< Button type = "primary" htmlType = "submit" >
1140
1276
Save
1141
1277
</ Button >
@@ -1566,6 +1702,11 @@ export const Settings = () => {
1566
1702
< Col span = { 24 } > { renderSettingForm ( ) } </ Col >
1567
1703
</ Row >
1568
1704
) }
1705
+ { idpCLicked && (
1706
+ < Row style = { { marginTop : "0" , width : "100%" } } >
1707
+ < Col span = { 24 } > { renderSettingForm ( ) } </ Col >
1708
+ </ Row >
1709
+ ) }
1569
1710
</ Col >
1570
1711
</ Row >
1571
1712
</ Container >
0 commit comments