473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Accessing Forms Auth Cookie from WinForm

I have an WinForm (VB.NET) that is launched from an ASP.NET page that uses
Form Authentication. After the WinForm is lauched it calls a web service. I
want to use the credentials stored in the cookie and authenticate them on
the web service side. Is there a way to access the information?

TIA,

Steve Wofford
www.IntrRELY.com
Nov 20 '05 #1
6 3187
Hi,

Thanks for using Microsoft MSDN Managed Newsgroup.

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 20 '05 #2
Hi Steve,

I am sorry if I misunderstanding you meaning.
Is the Winform you refer to a smart client?
And you wants to run the smart client in a Webform and get the credential
the user input in the webform authentication.

If so I think you can get the username and password directly from the
WebForm as pass to the smart client as arguments.
Here is article about pass argument to an smart client windows form
application.
Launching No-Touch Deployment Applications with Command Line Arguments
http://msdn.microsoft.com/library/de...us/dnforms/htm
l/winforms05152003.asp

Also you can pass the argument to the smart client when you launch it.

Dim us, ps As String
us = Me.TextBox1.Text 'username
ps = Me.TextBox2.Text 'password
Response.Redirect(("http://localhost/vacaplan.exe?uid=" + us + ps))

Also , can you tell did webservice you wants to call lie in the same server
with ASP.NET application? lie in the same directory? or in different server?
Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #3
Thanks Peter for another good response to my question.

This article seems like exactly what I want. After I try and implement it I
will post another specific question, but this look perfect.

To answer you question as you may have other options for me. The web service
I am calling will be in the same web application. However I did put it into
another directory as another project for the time being, because the root
web appliction does require forms auth, so I moved it so I could build the
web service application and throw the authentication on it last.

Thanks,

Steve Wofford
www.IntraRELY.com

"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:lA**************@cpmsftngxa07.phx.gbl...
Hi Steve,

I am sorry if I misunderstanding you meaning.
Is the Winform you refer to a smart client?
And you wants to run the smart client in a Webform and get the credential
the user input in the webform authentication.

If so I think you can get the username and password directly from the
WebForm as pass to the smart client as arguments.
Here is article about pass argument to an smart client windows form
application.
Launching No-Touch Deployment Applications with Command Line Arguments
http://msdn.microsoft.com/library/de...us/dnforms/htm l/winforms05152003.asp

Also you can pass the argument to the smart client when you launch it.

Dim us, ps As String
us = Me.TextBox1.Text 'username
ps = Me.TextBox2.Text 'password
Response.Redirect(("http://localhost/vacaplan.exe?uid=" + us + ps))

Also , can you tell did webservice you wants to call lie in the same server with ASP.NET application? lie in the same directory? or in different server?

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #4
Hi Steve,

Thanks for your quickly reply!

Based on my experience, it is a good practice to put the Webservice in
another directory which is different from the ASP.NET Form-authentication
Application.

Since the cookie is read for serverside, and the SmartClient(winform) is
running at client side. The SmartClient as a client side app can not read
the information from the cookie, it has been hashed by server and will be
read by server.

So you may try my last suggest, i.e. pass the parameter to the smartclient.
If you have any question, please post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #5
HI Steve,

Did you have any concern on this issue?
If so please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #6
Hi, I'm in the same situation and I'm passing parameters to the smart
client. I have a doubt: if I open the Internet Temporary Files folder
I can see one ".exe" for each of the combination of the parameters
like these:

xxxx.exe?param1=qqweqweqwe
xxxx.exe?param1=qeqwasd111
......
xxxx.exe?param1=123456789

This is: the user is downloading the same exe each time even when no
new version is available, and I thought this was one of the good
things for the no-touch deployment.

So, is there any solution to avoid this? I was thinking storing the
parameters in another cookie and accesing the cookies from the smart
client, but I'm not able to do that. Any idea for this??

Thank you very much,
\Diego

v-******@online.microsoft.com (Peter Huang) wrote in message news:<I1**************@cpmsftngxa07.phx.gbl>...
Hi Steve,

Thanks for your quickly reply!

Based on my experience, it is a good practice to put the Webservice in
another directory which is different from the ASP.NET Form-authentication
Application.

Since the cookie is read for serverside, and the SmartClient(winform) is
running at client side. The SmartClient as a client side app can not read
the information from the cookie, it has been hashed by server and will be
read by server.

So you may try my last suggest, i.e. pass the parameter to the smartclient.
If you have any question, please post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: e | last post by:
I'm using forms authentication on a site. When the user logs in via the login page, the entered creds are checked against AD, and if valid, an encrypted forms authentication ticket is produced and...
5
by: Gavin Stevens | last post by:
I'm trying to figure out the ASP.NET Forms Auth I have 3 or 4 pages i want to allow anonymous access to.. Then I have 5 or 6 pages I placed in another directory in the webproject. These I want...
4
by: 23s | last post by:
I had this problem in the past, after a server reformat it went away, and now after another server reformat it's back again - no clue what's doing it. Here's the flow: Website root is public, no...
1
by: AVance | last post by:
Hi, I've come across this scenario in ASP.NET 1.1 with forms authentication where the forms auth doesn't seem to timeout correctly, nor redirect to the login page. I have done some testing, and...
2
by: pv_kannan | last post by:
I recently found out that my authentication cookies are not expiring even though I have set the persist property to false. As a result, users are able to access the secure websites with indifferent...
7
by: mircu | last post by:
Hi, I noticed weird behaviour with the site that is using forms authentication. I am logged to the site from the same machine from two browsers (opened separately, not ctrl-N) as different users...
2
by: code | last post by:
Hi, I have stumbled across an interesting problem regarding forms authentication over multiple sub domains. The topic has been covered in various forms online but never really gets a definitive...
8
by: =?Utf-8?B?TFc=?= | last post by:
Hello! I am just learning about forms authentication so please excuse this basic question. I am using .NET 1.1 and C#. I have created my web.config file and my login.aspx and the associated cs...
4
by: =?Utf-8?B?RmFyaWJh?= | last post by:
It know that we can use the following method http://msdn2.microsoft.com/en-us/library/eb0zx8fc.aspx to form authenticate across multiple applications. I have created an asp.net application...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.