Re: How to Pass Windows User ID to Cute Chat

  •  08-14-2007, 10:55 PM

    Re: How to Pass Windows User ID to Cute Chat

    Adam,
     
    I am the web server admin, not a programmer. We are looking at a "canned" app because our programmers are too busy to write a chat app themselves. I figured your Cute Chat app could fit the bill on my IIS/.NET Intrantet without too much fuss.
     
    After hacking away at the global.asax myself, I THINK I've got it working for single sign-on by way of passing the user id to Cute Chat. My code is below. Please let me know how it looks to you. I do suggest you guys enhance the integration documentation by adding an example of IE/Intranet single sign-on. 
     
     
    Thanks,
     
    Jack
     
    *****global.asax***********

    <%@ Application Codebehind="Global.asax.cs" Inherits="SamplePortal.Global" %>

    <%@ Implements Interface="CuteSoft.Chat.IHttpApplicationUserAdapter" %>

    <Script runat=server Language=VB>

     
    #Region " IHttpApplicationUserAdapter Members "
       
        Public Function GetUserUniqueName() As String Implements CuteSoft.Chat.IHttpApplicationUserAdapter.GetUserUniqueName
            Session("userid")=ucase (Mid(Request.ServerVariables("LOGON_USER"),6))
     Return Session("userid")
        End Function
       
        Public Function GetUserIdentity() As CuteSoft.Chat.UserIdentity Implements CuteSoft.Chat.IHttpApplicationUserAdapter.GetUserIdentity
            Dim un As String = GetUserUniqueName()
            If un Is Nothing Then
                Return CuteSoft.Chat.UserIdentity.CreateNull()
            End If

            Return New CuteSoft.Chat.UserIdentity(un, Nothing, Context.Request.UserHostAddress)
        End Function
       
    #End Region


       
    </Script>

     
View Complete Thread