Results 1 to 9 of 9

Thread: [RESOLVED] How to implement Single Sign on VB6 client base project

  1. #1

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Resolved [RESOLVED] How to implement Single Sign on VB6 client base project

    Hi All,

    Anyone here have idea how to implement single sign on to VB6 project?

    I used to implement in vb.net 2003 - 2008 but don't have idea about VB6.

    Thank you very much.
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: How to implement Single Sign on VB6 client base project

    What exactly do you mean by "single sign on"?
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: How to implement Single Sign on VB6 client base project

    Quote Originally Posted by LaVolpe View Post
    What exactly do you mean by "single sign on"?
    Thanks LaVolpe,

    By using Windows NT Account as the authentication to log in to the system.
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  4. #4

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: How to implement Single Sign on VB6 client base project

    Hi All,

    Anyone have solution on it?
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  5. #5
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: How to implement Single Sign on VB6 client base project

    To log in to what system? Over what protocols?

    If the service you're using is not part of the same domain/workgroup then it isn't even practical, if possible at all. SQL Server connection strings can specify integrated authentication. Various HTTP Request objects can too, though that assumes (1.) IIS, and (2.) same domain/workgroup. The same goes for DCOM.

    I think we are still very much in the dark about what you want to do.

  6. #6

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: How to implement Single Sign on VB6 client base project

    Quote Originally Posted by dilettante View Post
    To log in to what system? Over what protocols?

    If the service you're using is not part of the same domain/workgroup then it isn't even practical, if possible at all. SQL Server connection strings can specify integrated authentication. Various HTTP Request objects can too, though that assumes (1.) IIS, and (2.) same domain/workgroup. The same goes for DCOM.

    I think we are still very much in the dark about what you want to do.
    Thanks dilettante for your prompt reply.

    I would like to implement the single sign-on to a client base system and
    the group of users are within same domain/workgroup.

    In vs.net 2003 the code below has been used to retrieve domain name of the user.

    Imports System.Security.Principal

    dim strDomainID as string

    strDomainID = Threading.Thread.CurrentPrincipal.Identity.Name

    How about VB6?

    Thanks in advance.
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

  7. #7
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: How to implement Single Sign on VB6 client base project

    In vs.net 2003 the code below has been used to retrieve domain name of the user.
    Imports System.Security.Principal
    dim strDomainID as string
    strDomainID = Threading.Thread.CurrentPrincipal.Identity.Name
    How about VB6?
    Here you'll find different ways to get that info in VB6:
    Using VB6, how do I get the current user and domain on Windows XP?

  8. #8
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: How to implement Single Sign on VB6 client base project

    Even if you get the User Name (easy) that doesn't do anything about authentication. But if you want to treat the name as already authenticated and send it to the server with no other credentials that works. You're just vulnerable to attacks if anyone sniffs your client/server traffic and finds out how to spoof messages, and this is pretty easy. You'd really want the traffic encrypted.
    Code:
    Private Const UNLEN = 256
    
    Private Declare Function GetUserName Lib "advapi32" Alias "GetUserNameW" ( _
        ByVal lpBuffer As Long, _
        ByRef nSize As Long) As Long
    
    Public Function User() As String
        Dim lngLen As Long
        Dim lngResult As Long
        Dim strUser As String
        
        lngLen = UNLEN
        strUser = String$(lngLen, 0) 'VB Strings have an implied NUL after the last char.
        lngResult = GetUserName(StrPtr(strUser), lngLen + 1)
        If lngResult <> 0 Then
            User = Left$(strUser, lngLen - 1)
        Else
            User = ""
        End If
    End Function

  9. #9

    Thread Starter
    Hyperactive Member nUflAvOrS's Avatar
    Join Date
    Jul 2007
    Location
    Malaysia/ Currently at Singapore
    Posts
    372

    Re: How to implement Single Sign on VB6 client base project

    Thanks jcis and dilettante.
    I had tried of both approaches,both were working.
    Only that the solution given by dilettante returned special character to me.
    I couldn't get rid of this character.

    Thanks anyway :-)
    Problem resolved
    Where there is no hope, there can be no endeavor.

    There are two ways of rising in the world, either by your own industry or by the folly of others.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width