|
-
Jun 20th, 2011, 03:01 AM
#1
Thread Starter
Hyperactive Member
[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.
-
Jun 20th, 2011, 08:39 AM
#2
Re: How to implement Single Sign on VB6 client base project
What exactly do you mean by "single sign on"?
-
Jun 20th, 2011, 07:04 PM
#3
Thread Starter
Hyperactive Member
Re: How to implement Single Sign on VB6 client base project
 Originally Posted by LaVolpe
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.
-
Sep 18th, 2011, 09:23 PM
#4
Thread Starter
Hyperactive Member
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.
-
Sep 18th, 2011, 10:57 PM
#5
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.
-
Sep 18th, 2011, 11:12 PM
#6
Thread Starter
Hyperactive Member
Re: How to implement Single Sign on VB6 client base project
 Originally Posted by dilettante
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.
-
Sep 19th, 2011, 10:42 PM
#7
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?
-
Sep 20th, 2011, 01:18 PM
#8
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
-
Oct 6th, 2011, 04:28 AM
#9
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|