![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a web service that need to be authenticated to allow users to connect. I'm building a Web Application to access this WS. I want every one to be able to acces the application. if( System.Threading.Thread.CurrentPrincipal.Identity. IsAuthenticated ) { _WS.Credentials = System.Net.CredentialCache.DefaultCredentials; } else { System.Net.NetworkCredential oCreds = new System.Net.NetworkCredential(); oCreds.Domain = "domain"; oCreds.UserName = "user"; oCreds.Password = "password"; _WS.Credentials = oCreds; } I have three problems/questions... a) What do experienced people think of this solution. Instead of IsAuthenticated I would simply pass the Default Credetials. This |
|
b) I need to do Unit Test for this, can I simulate a not logged user ??? Yeah, use a computer or virtual computer not logged on the the domain and |
|
c) How should I make the password secure ?? Check (a) or use SSL. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |