dennis-garavsky
/
XAF_how-to-use-google-facebook-and-microsoft-accounts-in-aspnet-xaf-applications-oauth2-demo-t535280
Public
forked from DevExpress-Examples/xaf-web-forms-use-oauth2-authentication-providers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Global.asax.vb
74 lines (70 loc) · 3 KB
/
Global.asax.vb
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
Imports Microsoft.VisualBasic
Imports System
Imports System.Configuration
Imports System.Web.Configuration
Imports System.Web
Imports DevExpress.ExpressApp
Imports DevExpress.Persistent.Base
Imports DevExpress.Persistent.BaseImpl
Imports DevExpress.ExpressApp.Security
Imports DevExpress.ExpressApp.Web
Imports DevExpress.Web
Namespace AuthenticationOwin.Web
Public Class [Global]
Inherits System.Web.HttpApplication
Public Sub New()
InitializeComponent()
End Sub
Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
SecurityAdapterHelper.Enable()
AddHandler ASPxWebControl.CallbackError, AddressOf Application_Error
#If EASYTEST Then
DevExpress.ExpressApp.Web.TestScripts.TestScriptsManager.EasyTestEnabled = True
#End If
End Sub
Protected Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Tracing.Initialize()
WebApplication.SetInstance(Session, New AuthenticationOwinAspNetApplication())
DevExpress.ExpressApp.Web.Templates.DefaultVerticalTemplateContentNew.ClearSizeLimit()
WebApplication.Instance.SwitchToNewStyle()
WebApplication.Instance.Settings.LogonTemplateContentPath = "LogonTemplateContent1.ascx"
If ConfigurationManager.ConnectionStrings("ConnectionString") IsNot Nothing Then
WebApplication.Instance.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
End If
#If EASYTEST Then
If ConfigurationManager.ConnectionStrings("EasyTestConnectionString") IsNot Nothing Then
WebApplication.Instance.ConnectionString = ConfigurationManager.ConnectionStrings("EasyTestConnectionString").ConnectionString
End If
#End If
If System.Diagnostics.Debugger.IsAttached AndAlso WebApplication.Instance.CheckCompatibilityType = CheckCompatibilityType.DatabaseSchema Then
WebApplication.Instance.DatabaseUpdateMode = DatabaseUpdateMode.UpdateDatabaseAlways
End If
WebApplication.Instance.ConnectionString = DevExpress.ExpressApp.Xpo.InMemoryDataStoreProvider.ConnectionString
WebApplication.Instance.Setup()
WebApplication.Instance.Start()
End Sub
Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Protected Sub Application_EndRequest(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Protected Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Protected Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
ErrorHandling.Instance.ProcessApplicationError()
End Sub
Protected Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
WebApplication.LogOff(Session)
WebApplication.DisposeInstance(Session)
End Sub
Protected Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
End Sub
#Region "Web Form Designer generated code"
''' <summary>
''' Required method for Designer support - do not modify
''' the contents of this method with the code editor.
''' </summary>
Private Sub InitializeComponent()
End Sub
#End Region
End Class
End Namespace