How to Pass Windows User ID to Cute Chat

Last post 08-16-2007, 8:58 AM by sstepanski. 5 replies.
Sort Posts: Previous Next
  •  08-13-2007, 8:12 PM 32430

    How to Pass Windows User ID to Cute Chat

    Hello,
     
    I've got Cute Chat 3.1 (.NET 2.0) running on an IIS server on my AD domain. I have set the IIS server to require integrated Windows auth, such that I can retreive the AD user id via the LOGON_USER value from the Request.ServerVariables object. I can also then set a browser session variable such that it will carry that user id through the IE session.
     
    My question is: How can I pass this user id variable on to Cute Chat such that it will automatically use it for the user's ID. No need for a user database per se, just need Cute Chat to use the user id I've already declared. I'm hoping to have all the chat users' names automatically filled in, and they not see any Cute Chat login prompt.
     
     
    Thanks,
     
    Jack
     
     
  •  08-14-2007, 2:20 AM 32439 in reply to 32430

    Re: How to Pass Windows User ID to Cute Chat

    Jack,
     
    Cute Chat just need the current username. You can get this user name from sessions, active directory, cookie .....
     

    Implement IHttpApplicationUserAdapter interface and Let CuteChat know who has logged in the website


    In this step, you need to implement one simple method:

    //Retrieves the unique identity of the current user
    public CuteSoft.Chat.UserIdentity GetUserIdentity()

    Code Example

    public string GetUserUniqueName()

    {    
         if (Context.User.Identity.IsAuthenticated)
            return Context.User.Identity.Name; 
        return null;

    }

    public CuteSoft.Chat.UserIdentity GetUserIdentity()

    {

        string uniquename = GetUserUniqueName();

        if (uniquename == null)

        {

            return CuteSoft.Chat.UserIdentity.CreateNull();

        }

        CuteSoft.Chat.UserIdentity identity = new CuteSoft.Chat.UserIdentity(uniquename, null, Request.UserHostAddress);

        return identity;

    }


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  08-14-2007, 6:52 AM 32444 in reply to 32430

    Re: How to Pass Windows User ID to Cute Chat

    I know little to nothing about programming but I would like to authenticate user automatically for web messeger. First you have been discussing this regarding cute chat. Does it work with cute web messenger? Secondly can you give more information to help guide us newbies through setting this up?
  •  08-14-2007, 1:14 PM 32458 in reply to 32444

    Re: How to Pass Windows User ID to Cute Chat

    sstepanski,
     
    The above information also works for Cute Web Messenger and Cute Live Support.
     
    To integrate with your own user membership, you must know asp.net and your own system. If you are not a developer, you need to get the guy who built your site to help you.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  08-14-2007, 10:55 PM 32480 in reply to 32458

    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>

     
  •  08-16-2007, 8:58 AM 32531 in reply to 32480

    Re: How to Pass Windows User ID to Cute Chat

    I can't get the user logon to pass to messenger. When I access messenger IE asks for username and password be windows auth is on. Can anyone tell me how to link to AD or user logon.
View as RSS news feed in XML