%
Class SAMLHandler
' See appendix A of FSE SSO Service Providers Developers Guide
' for full list of attributes provided in the UserAttributes structure
' i.e. oUserAttributes.USER_FIRSTNAME, etc...
' In addition to the user profile attributes described in the appendix
' this sample references ssoId, and localId to refer to the
' Single Sign On Id and the Local User Account ID respectively
Public Function createTransactionId()
' the purpose of this function is to generate unique transactions
' id values to be used during the SAML handshake process
Set TypeLib = CreateObject("Scriptlet.TypeLib")
createTransactionId = Left(CStr(TypeLib.Guid), 38)
Set TypeLib = Nothing
End Function
Public Sub onSuccess( txId, oUserAttributes )
' called on a successful sso handshake
Response.Write "onSuccess " + oUserAttributes.USER_FIRSTNAME
End Sub
Public Sub onError( txId, sErrorMessage )
' called when a error occurs
Response.Write "
" + sErrorMessage + "
"
End Sub
Public Sub logMessage( txId, sSeverity, sMessage )
' write a log message to the appropriate place
Response.Write "" + sSeverity +" " + sMessage + "
"
End Sub
Public Sub logData( txId, sData )
' log data to the appropriate place
Response.Write "" + Server.HTMLEncode( sData ) + "
"
End Sub
Public Function lookupLocalUserId( txId, sSSOId )
Dim localUserId
' Use the SSO Id to lookup the local user id
localUserId = ""
' return the local user id or empty string if not found
lookupLocalUserId = localUserId
End Function
Public Function createLocalUserAccount( txId, oUserAttributes )
Dim newLocalUserId
' Create a new local user account based on the SSO user profile
newLocalUserId = "mgriffin"
' return local user account id if success or empty string otherwise
createLocalUserAccount = newLocalUserId
End Function
Public Function updateLocalUserAccount( txId, oUserAttributes )
Dim accountUpdated
' Update the local user account based on the SSO user profile
' The local user account id is oUserAttributes.localId
accountUpdated = true
' return true if it was updated, false otherwise
updateLocalUserAccount = accountUpdated
End Function
Public Function startUserSession( txId, oUserAttributes )
Dim sessionStarted
' Start a new local user session for the SSO user
' The local user account id is oUserAttributes.localId
' The SSO user account id is oUserAttributes.ssoId
Session( "userId" ) = oUserAttributes.localId
Session( "ssoId" ) = oUserAttributes.ssoId
Session( "userName" ) = oUserAttributes.USER_FIRSTNAME + " " + oUserAttributes.USER_LASTNAME
sessionStarted = true
' return true if the session was started, false otherwise
startUserSession = sessionStarted
End Function
End Class
%>