Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 525
  • Last Modified:

How to best pass along authentication usernames and passwords

I have a web application that authenticates users against my LDAP.  I would then like to pass that information along to other forms, like our exchange server, our hr servers, etc...  I can programmatically recreate the form that each signin page uses, and that works fine, however, the user user name and password are actually written into the page code, I am looking for a more secure method to implement this pseudo-single sign on.

Thank you, any advice would be greatly appreciated.
0
shanemay
Asked:
shanemay
  • 4
  • 3
1 Solution
 
amanolaCommented:
On authentication you can store the Username/Password in Session variables. That way they are accessible anywhere in the site without ever being visibile in the code.
0
 
shanemayAuthor Commented:
Right, I understand that, however, how do I dynamically re-create the forms and auto submit them with the information stored in the session variables.   Now I read the username and password out of the session and write them directly into the code.

Thank you for the reply.  
0
 
Ted BouskillSenior Software DeveloperCommented:
Is this an intranet application?
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
shanemayAuthor Commented:
No, it is not.  It is a public portal of users and staff.    
0
 
Ted BouskillSenior Software DeveloperCommented:
Hmm sounds dangerous.  True integrationed Windows Authentication uses a one-way hash that protects the user name/password combinations.  You are going to have to use SSL throughout your application and if your front-end server is penetrated any DLLs you create in .NET can be reverse engineered to expose the authentication data.

Have you looked at any articles for using Windows Authentication and Kerberos?
0
 
shanemayAuthor Commented:
I agree, i do not like the process, and yes I will have SSL throughout the application.  I am basically recreating the forms and submitting them for the user.  The only problem is that when I create the form dynamically, the username and password is rendered with the code.  I really need to find a way to have multiple forms per aspx page.  I really think that would solve the problem.

Thank you for your help.
0
 
Ted BouskillSenior Software DeveloperCommented:
Hmm, sadly .NET doesn't support multiple forms per page.  You could use impersonation.  In other words when you receive the username password instead of authenticating against LDAP you create an authentication token you can relay to the other sites which could then support Windows Authentication.
http://msdn.microsoft.com/en-us/library/system.security.principal.windowsidentity.impersonate(VS.71).aspx

So just to be clear let's go over the details again.

Scenario #1: Full Windows Authentication
ClientA
WebProxyA: Windows Authentication (The server you are using to relay credentials)
ExchSvrA,HrServerA,...: Windows Authentication

Scenario #1 will fail because windows credentials cannot be related to ExchSrvrA, HrServerA et cetera

Scenario #2: All forms authentication
ClientA
WebProxyA: Forms Authentication
ExchSvrA,HrServerA,...: Forms Authentication

Scenario #2 works but the credentials stored in WebProxyA are vulnerable to snooping (I would store them in session variables)

Scenario #3: Combo of Forms and Windows Authentication
ClientA
WebProxyA: Forms Authentication
ExchSvrA,HrServerA,...: Windows Authentication

Scenario #3 still captures the users login name and password protected by SSL but you generate a user identity when they log in to then relay to the Windows Authentication servers like HrServerA, which means you don't have to store the credentials just the identity token!
0
 
shanemayAuthor Commented:
Sorry for the late reply, Thank you for the outstanding advice and help.  
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now