forked from content-manager-sdk/Community
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponentSpaceSAMLPlugin.cs
More file actions
44 lines (33 loc) · 1.12 KB
/
Copy pathComponentSpaceSAMLPlugin.cs
File metadata and controls
44 lines (33 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using HP.HPTRIM.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ServiceStack;
using ServiceStack.Auth;
using ServiceStack.Web;
using System.Web;
namespace ComponentSpaceSAMLPlugin
{
public class ComponentSpaceSAMLPlugin : IReconfigure
{
public void Configure(IAppHost appHost)
{
var appSettings = new ServiceStack.Configuration.AppSettings();
if (appHost.Plugins.Exists(p => p is AuthFeature))
{
appHost.Plugins.Remove(appHost.Plugins.First(p => p is AuthFeature));
}
string samlLogin = appSettings.GetString("saml.login");
if (samlLogin == null)
{
samlLogin = "~/auth/saml";
}
// HostContext.Config.WebHostUrl = appSettings.GetString("saml.WebHostUrl");
appHost.Plugins.Add(new AuthFeature(() => new SamlUserSession(), new IAuthProvider[] {
new jitbitSamlAuthProvider(appSettings),
}, samlLogin));
}
}
}