@@ -18,6 +18,7 @@ public class ConfigResponseModel : ResponseModel
1818 public EnvironmentConfigResponseModel Environment { get ; set ; }
1919 public IDictionary < string , object > FeatureStates { get ; set ; }
2020 public PushSettings Push { get ; set ; }
21+ public CommunicationSettings Communication { get ; set ; }
2122 public ServerSettingsResponseModel Settings { get ; set ; }
2223
2324 public ConfigResponseModel ( ) : base ( "config" )
@@ -48,6 +49,7 @@ IGlobalSettings globalSettings
4849 FeatureStates = featureService . GetAll ( ) ;
4950 var webPushEnabled = FeatureStates . TryGetValue ( FeatureFlagKeys . WebPush , out var webPushEnabledValue ) ? ( bool ) webPushEnabledValue : false ;
5051 Push = PushSettings . Build ( webPushEnabled , globalSettings ) ;
52+ Communication = CommunicationSettings . Build ( globalSettings ) ;
5153 Settings = new ServerSettingsResponseModel
5254 {
5355 DisableUserRegistration = globalSettings . DisableUserRegistration
@@ -88,6 +90,36 @@ public static PushSettings Build(bool webPushEnabled, IGlobalSettings globalSett
8890 }
8991}
9092
93+ public class CommunicationSettings
94+ {
95+ public string Type { get ; private init ; }
96+ public string IdpLoginUrl { get ; private init ; }
97+ public string CookieName { get ; private init ; }
98+ public string CookieDomain { get ; private init ; }
99+
100+ public static CommunicationSettings Build ( IGlobalSettings globalSettings )
101+ {
102+ var bootstrap = globalSettings . Communication ? . Bootstrap ? . ToLowerInvariant ( ) ;
103+
104+ if ( string . IsNullOrEmpty ( bootstrap ) || bootstrap == "none" )
105+ {
106+ return null ;
107+ }
108+
109+ return bootstrap switch
110+ {
111+ "ssocookievendor" => new CommunicationSettings
112+ {
113+ Type = "ssoCookieVendor" ,
114+ IdpLoginUrl = globalSettings . Communication ? . SsoCookieVendor ? . IdpLoginUrl ,
115+ CookieName = globalSettings . Communication ? . SsoCookieVendor ? . CookieName ,
116+ CookieDomain = globalSettings . Communication ? . SsoCookieVendor ? . CookieDomain
117+ } ,
118+ _ => null
119+ } ;
120+ }
121+ }
122+
91123public class ServerSettingsResponseModel
92124{
93125 public bool DisableUserRegistration { get ; set ; }
0 commit comments