-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathGoogleAuthenticationStartup.cs
More file actions
111 lines (98 loc) · 4.69 KB
/
GoogleAuthenticationStartup.cs
File metadata and controls
111 lines (98 loc) · 4.69 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Google;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using OrchardCore.DisplayManagement.Extensions;
using OrchardCore.Google.Analytics;
using OrchardCore.Google.Analytics.Drivers;
using OrchardCore.Google.Analytics.Services;
using OrchardCore.Google.Analytics.Settings;
using OrchardCore.Google.Authentication.Configuration;
using OrchardCore.Google.Authentication.Drivers;
using OrchardCore.Google.Authentication.Services;
using OrchardCore.Google.Authentication.Settings;
using OrchardCore.Google.TagManager;
using OrchardCore.Google.TagManager.Drivers;
using OrchardCore.Google.TagManager.Services;
using OrchardCore.Google.TagManager.Settings;
using OrchardCore.Modules;
using OrchardCore.Navigation;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings.Deployment;
namespace OrchardCore.Google;
[Feature(GoogleConstants.Features.GoogleAuthentication)]
public sealed class GoogleAuthenticationStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddPermissionProvider<GoogleAuthenticationPermissionProvider>();
services.AddSingleton<GoogleAuthenticationService, GoogleAuthenticationService>();
services.AddSiteDisplayDriver<GoogleAuthenticationSettingsDisplayDriver>();
services.AddNavigationProvider<GoogleAuthenticationAdminMenu>();
// Register the options initializers required by the Google Handler.
// Orchard-specific initializers:
services.AddTransient<IConfigureOptions<AuthenticationOptions>, GoogleOptionsConfiguration>();
services.AddTransient<IConfigureOptions<GoogleOptions>, GoogleOptionsConfiguration>();
// Built-in initializers:
services.AddTransient<IPostConfigureOptions<GoogleOptions>, OAuthPostConfigureOptions<GoogleOptions, GoogleHandler>>();
services.AddTransient<IConfigureOptions<GoogleAuthenticationSettings>, GoogleAuthenticationSettingsConfiguration>();
}
}
[Feature(GoogleConstants.Features.GoogleAnalytics)]
public sealed class GoogleAnalyticsStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddPermissionProvider<GoogleAnalyticsPermissionsProvider>();
services.AddSingleton<IGoogleAnalyticsService, GoogleAnalyticsService>();
services.AddSiteDisplayDriver<GoogleAnalyticsSettingsDisplayDriver>();
services.AddNavigationProvider<GoogleAnalyticsAdminMenu>();
services.Configure<MvcOptions>((options) =>
{
options.Filters.Add<GoogleAnalyticsFilter>();
});
}
}
[Feature(GoogleConstants.Features.GoogleTagManager)]
public sealed class GoogleTagManagerStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddPermissionProvider<GoogleTagManagerPermissionProvider>();
services.AddSingleton<IGoogleTagManagerService, GoogleTagManagerService>();
services.AddSiteDisplayDriver<GoogleTagManagerSettingsDisplayDriver>();
services.AddNavigationProvider<GoogleTagManagerAdminMenu>();
services.Configure<MvcOptions>((options) =>
{
options.Filters.Add<GoogleTagManagerFilter>();
});
}
}
[Feature(GoogleConstants.Features.GoogleAuthentication)]
[RequireFeatures("OrchardCore.Deployment")]
public sealed class GoogleAuthenticationDeploymentStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddSiteSettingsPropertyDeploymentStep<GoogleAuthenticationSettings, GoogleAuthenticationDeploymentStartup>(S => S["Google Authentication Settings"], S => S["Exports the Google Authentication settings."]);
}
}
[Feature(GoogleConstants.Features.GoogleAnalytics)]
[RequireFeatures("OrchardCore.Deployment")]
public sealed class GoogleAnalyticsDeploymentStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddSiteSettingsPropertyDeploymentStep<GoogleAnalyticsSettings, GoogleAnalyticsDeploymentStartup>(S => S["Google Analytics Settings"], S => S["Exports the Google Analytics settings."]);
}
}
[Feature(GoogleConstants.Features.GoogleTagManager)]
[RequireFeatures("OrchardCore.Deployment")]
public sealed class GoogleTagManagerDeploymentStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddSiteSettingsPropertyDeploymentStep<GoogleTagManagerSettings, GoogleTagManagerDeploymentStartup>(S => S["Google Tag Manager Settings"], S => S["Exports the Google Tag Manager settings."]);
}
}