473,807 Members | 2,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3203
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 misunderstandin g 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/winforms0515200 3.asp

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

Dim us, ps As String
us = Me.TextBox1.Tex t 'username
ps = Me.TextBox2.Tex t 'password
Response.Redire ct(("http://localhost/vacaplan.exe?ui d=" + 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.m icrosoft.com> wrote in message
news:lA******** ******@cpmsftng xa07.phx.gbl...
Hi Steve,

I am sorry if I misunderstandin g 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/winforms0515200 3.asp

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

Dim us, ps As String
us = Me.TextBox1.Tex t 'username
ps = Me.TextBox2.Tex t 'password
Response.Redire ct(("http://localhost/vacaplan.exe?ui d=" + 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(win form) 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.m icrosoft.com (Peter Huang) wrote in message news:<I1******* *******@cpmsftn gxa07.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(win form) 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
6374
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 stored in the forms auth cookie (and written to the client), using this code: ____________________ 'create the forms auth ticket objAuthTicket = New FormsAuthenticationTicket(1, txtUsername.Text, _ DateTime.Now, DateTime.Now.AddMinutes(8),...
5
2881
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 to manually authenticate users to provide acess My project has 2 web.config files... the default file <authentication mode="Forms"><forms loginUrl="Login.aspx" protection="All" timeout="30"...
4
5647
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 SSL no forms auth. One of the subfolders in the public area is the root of a "protected" area; SSL is required from this subfolder on forward and a web.config in the subfolder specifies forms authentication. From the public area, I provide a...
1
2199
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 I believe I've found a solution, but I would like some insight from Microsoft on whether the code I've implemented is correct, and why it is even working. Here is my scenario:
2
2746
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 results. Any pointers/suggestions would be very appreciated. Things were running as usual till until recently. Here are the relevant pieces of code ==========================================
7
1747
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 so two sessions are created. Then from the one window I logoff but I'm automatically logouted also from the other browser window. Why? It is strange that it is working OK if I'm doing it on the same machine where the web server is located.
2
2503
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 answer as to why it happens. I have two separate web apps sat on different sub domains of the same company realm. eg:
8
2156
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 file using examples on MSDN. I have created a FormsAuthenticationTicket and cookie and added the cookie to the response and then set the SetAuthCookie etc. When I go to the redirected page, I am not sure how to read the cookie value so I know who...
4
3607
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 that supports form authentication. My application is going to be called by another legacy application (HTML) which does the initial authentication.Something like this: <form name="form1" action="auth.asp" method="post" >
0
10372
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10112
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.