473,406 Members | 2,356 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,406 software developers and data experts.

How to use FormsAuthentication class in Desktop application (VB.net)?

Hi
how can I use FormsAuthentication.HashPasswordForStoringInConfig File Method in my vb.net application
I would like to achieve the same PHP crypt() function for encrypting password.
However I've only seen FormsAuthentication class being used in asp.net, not in vb.net
So I was wondering what should I do in order to use that method in my desktop application.
Nov 22 '05 #1
2 2743
..NET has a very well designed authentication and authorization
infrastructure. It is all based off of the IIdentity and IPrinciapl
interfaces. I would start looking at them. There are GenericIdentity and
GenericPrincipal classes already built that you can use or you can create
your own classes that implement the interfaces and create your own.

Just as in ASP.NET, you will have to build your own login form. There you
will need to establish the objects and tie them to the thread
(Thread.CurrentPrincipal = yourPrincipalObject). Then you can check the
roles (Thread.CurrentPrincipal.IsInRole("xxx")) to determine the
functionality that will execute or look at the PrincipalPermissionAttribute
for locking down whole methods and classes.

As far as encryption, passwords are normally encrypted with a 1 way
function. Have a look at the SHA1Managed class for that. You can do
reversible encryption as well, but that is quite a bit more in depth and not
recommended for passwords anyways.

--
Eric Marvets
Principal Consultant

the bang project

<shameless self promotion>

Email sa***@bangproject.com for Information on Our Architecture and
Mentoring Services

</shameless self promotion>
Nov 22 '05 #2
Hi
does that mean I can't use FormsAuthentication class in my VB.net application
Does that mean I can only use "system.Security.Cryptography.SHA1"
I can't seems to get the password encrypted right

For example if my password is "myownpwd", after encryption it should return me "my47.JHDDF6Qo
I have earlier used php crypt() to encrypt all the passwords. The salt is the same as the password itself

Please advice me how can I get it right my VB.net application. Thanks alot.
Nov 22 '05 #3

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

Similar topics

10
by: mail2deepa | last post by:
Hello, I want to know the difference between desktop application and intranet application. when to do desktop application and when intranet application. deepa
8
by: Uttam | last post by:
Hello, I am currently in the process of developing an application in a pure desktop world using Access 2000. I am intending to convert this pure desktop application into a Client Server...
4
by: Elhanan | last post by:
hi.. all a client of ours is considering to move from a dos application to windows desktop application. the application is for traveling agency, the database is rather large. their current...
1
by: matt | last post by:
Hi, I'm writing a HttpModule which is going to require certain settings in the FormsAuthentication configuration (for example, I need to ensure enableCrossAppRedirects = true). Now my best...
2
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I wonder whether this article http://msdn2.microsoft.com/en-us/library/ms973831.aspx is still applicable to ..net 2.0/.net 3.0 and the current computing environment. Also, does it happen that an...
1
by: Bartholomew Simpson | last post by:
I wrote a desktop application in C++ a little while ago, and I will like to port it to a web application. Here are the details: 1). ALL business logic is held in ANSI C++ libraries (e.g. I...
2
by: sezanawa | last post by:
Hi Guys, I am new to java deployment things. Specially for desktop applications. I used to work with J2EE and i did deployment only for web projects. Now i have developed a small desktop...
0
by: Ehsan1986 | last post by:
Hi I want to make Remote Desktop Application using c#.net but i am get confused while starting it. can anyone tell me , Is c#.net have support for this type of projects and can i make this...
2
ranjana1980
by: ranjana1980 | last post by:
How to deploy our desktop application in Dot Net with database what Steps to Deploy Desktop application in Dot Net
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.