Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Security / February 2008

Tip: Looking for answers? Try searching our database.

Secure single sign on/automatic login?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Samuel.cyprian@gmail.com - 06 Feb 2008 10:16 GMT
Hi guys!

I need your input on how to solve a problem that we have.
Our company provides a web-service, a SaaS.
Our idea is to create a destop appilication that can communicate with
the web service using https.
I have written a .net app in C#, and I need ideas on how I can login a
user without the user needing to type his username and password each
time.
The idea is that the user inputs his username and password once and
then checks the checkbox to automatically login. Now the user doesn't
need to input his login details each time the program restarts. My
criteria is that the client should never store the password (clear-
text or encrypted) on the local machine.

This is my idea for a solution.
User input the username and password on the desktop-client
The client sends the login details to the webserver, over ssl.
The server verifies the login details and sends back a challenge to
the client, if the username and password was correct.
The client then computes a static value using DAPI. This is how i do
it:

Code Snippet

private static RSA GetKey(DataProtectionScope scope)
       {
           switch (scope)
           {
               case DataProtectionScope.CurrentUser:
                   if (user == null)
                   {
                       CspParameters csp = new CspParameters();
                       csp.KeyContainerName = "DAPI";
                       user = new RSACryptoServiceProvider(1536,
csp);
                   }
                   return user;
               default:
                   throw new CryptographicException("Invalid
scope.");
           }
       }

RSA rsaKey = GetKey(DataProtectionScope.CurrentUser);
RSAParameters keyParam = rsaKey.ExportParameters(true);

Then I use keyParam.P, which is the private key as the static value.
And this static value is dependent on the current user that is loged
in to the OS.
I use the static value and the challenged recieved from the server to
compute a hash value, H(keyParam.P, challenge).
The client send this value back to the server, and the server will use
this hash value in future authentication.

So from now on, the client needs to compute this hash value on
runtime, each time he wants to access the webservice.

I think this is strong enough for authentication. But the only problem
I see with this solution is that the server has no idea what
application is communicating with it. I want from the server only
allow application signed or certified by us to contact the server.
Because, the problem I see is that, an attacker can create an
imitation of my destop client and fetch information from the server,
if the user chooses to use "automatic login" feature.

I hope you guys understand my problem. Any replies will be deeply
appreciated!

Thank,
/SC
Dominick Baier - 06 Feb 2008 11:04 GMT
you can leverage the built in Windows credential manager.

You have to P/Invoke CredUIPromptForCredentials and friends.

have a look at www.pinvoke.net

-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

> Hi guys!
>
[quoted text clipped - 63 lines]
> Thank,
> /S
Samuel.cyprian@gmail.com - 06 Feb 2008 11:53 GMT
On 6 Feb, 12:04, Dominick Baier
<dbaier@pleasepleasenospam_leastprivilege.com> wrote:
> you can leverage the built in Windows credential manager.
>
[quoted text clipped - 74 lines]
> > Thank,
> > /SC

Thank you for your reply!

But, the idea is that the user shouldn't be requiried to authenticate
himself, if he has chosen the option "login automatically".
I want to achive authentication as described above. I think that the
authentication process is swcure. But the problem is that an attacker
can impersonate my desktop client, and thus have access to the
webservice using the real users acount (if the real user chose to
login automatically, when he got the login dialog).
So is there a way to be sure at the server side that the client
(application) that's trying to connect with the server is acctually
certified by the server. In other words, can we identify which
application is trying to connect to the web-service?

/SC
Valery Pryamikov - 07 Feb 2008 11:36 GMT
If you can afford to put your users in AD, then use integrated windows
authentication (with kerberos) and you'll get you a good security
solution with single sign-on.

Otherwise, try looking for existent solution for secure authentication
and single sign on - what you have just described looks more like a
security disaster...

-Valery.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.