This commit is contained in:
Siwat Sirichai 2025-06-09 00:20:27 +07:00
parent f9493ca91b
commit 5c66212388
5 changed files with 166 additions and 17 deletions

View file

@ -12,6 +12,7 @@ Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports BaseClasses
@ -244,11 +245,16 @@ Partial Public Class SignIn
CancelButton_Click_Base(sender, args)
' NOTE: If the Base function redirects to another page, any code here will not be executed.
End Sub
Public Sub OKButton_Click(ByVal sender As Object, ByVal args As EventArgs)
Public Sub OKButton_Click(ByVal sender As Object, ByVal args As EventArgs)
' Click handler for OKButton.
' Customize by adding code before the call or replace the call to the Base function with your own code.
OKButton_Click_Base(sender, args)
' Redirect to SAML authentication instead of traditional login
Try
Dim samlRequest As String = SamlHelper.CreateAuthRequest("https://cudreg.com", Request.Url.GetLeftPart(UriPartial.Authority) & "/Security/SamlCallback.aspx")
Dim redirectUrl As String = "https://sso.satitm.chula.ac.th/adfs/ls?SAMLRequest=" & HttpUtility.UrlEncode(samlRequest)
Response.Redirect(redirectUrl)
Catch ex As Exception
Me.ProcessLoginFailed("SAML Authentication Error: " & ex.Message, "")
End Try
' NOTE: If the Base function redirects to another page, any code here will not be executed.
End Sub