473,385 Members | 1,927 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,385 software developers and data experts.

How to get password server side with basic authentication

Book: "Building Secure ASP.NET Applications", at page 276 says:

I'm speaking about .NET Remoting Security chapter.

"With Basic Authentication the username and password are available to the server
in clera text."

Now, I get username in this way:

System.Web.HttpContext.Current.User.Identity.Name

and how to get the password?

Sep 5 '06 #1
4 8522
Tommaso,

At that point, I am kind of wondering, why do you want it? The user is
authenticated at that point, and you can be assured that they have logged in
correctly.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tommaso Caldarola" <il********@lcimitero.itwrote in message
news:44**********@x-privat.org...
Book: "Building Secure ASP.NET Applications", at page 276 says:

I'm speaking about .NET Remoting Security chapter.

"With Basic Authentication the username and password are available to the
server in clera text."

Now, I get username in this way:

System.Web.HttpContext.Current.User.Identity.Name

and how to get the password?

Sep 5 '06 #2
Nicholas Paldino [.NET/C# MVP] wrote:
Tommaso,

At that point, I am kind of wondering, why do you want it? The user is
authenticated at that point, and you can be assured that they have logged in
correctly.

If I put in client code

IDictionary props = ChannelServices.GetChannelSinkProperties(proxy);
props["username"] = "dummyremotinguser";
props["password"] = "12345";

and then I call proxy.Method()

on the server side in host on IIS (where do I set basic authentication) I got:

IPrincipal principal = System.Web.HttpContext.Current.User;

here I want to perform custom authentication on LDAP or Database, the user IS
NOT AUTHENTICATED at this point, how do it? I need to know pasword too.


Sep 5 '06 #3
Tommaso,

Actually, the user is authenticated, from the perspective of IIS. From
the perspective of LDAP or Database, no, it is not.

There are two solutions here. The first is to not always use different
credentials when accessing the database or an LDAP. Rather, you should
create an account under which your service runs, and then grant access to
that service account. This actually improves scalability when working with
databases, as the connections can be pooled. However, if you are putting
different client credentials together for each connection to the database,
you can't pool them.

Of course, you would have to manage access to the database yourself, but
it's a better alternative, IMO.

The second option would be to use Windows authentication. Then you need
to set IIS up to impersonate the user that is connected. Then, you can use
integrated security to attach to the database and to LDAP.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tommaso Caldarola" <il********@lcimitero.itwrote in message
news:44**********@x-privat.org...
Nicholas Paldino [.NET/C# MVP] wrote:
>Tommaso,

At that point, I am kind of wondering, why do you want it? The user
is authenticated at that point, and you can be assured that they have
logged in correctly.


If I put in client code

IDictionary props = ChannelServices.GetChannelSinkProperties(proxy);
props["username"] = "dummyremotinguser";
props["password"] = "12345";

and then I call proxy.Method()

on the server side in host on IIS (where do I set basic authentication) I
got:

IPrincipal principal = System.Web.HttpContext.Current.User;

here I want to perform custom authentication on LDAP or Database, the user
IS NOT AUTHENTICATED at this point, how do it? I need to know pasword too.


Sep 5 '06 #4

"Tommaso Caldarola" <il********@lcimitero.itwrote in message
news:44**********@x-privat.org...
| Nicholas Paldino [.NET/C# MVP] wrote:
|
| Tommaso,
| >
| At that point, I am kind of wondering, why do you want it? The user
is
| authenticated at that point, and you can be assured that they have
logged in
| correctly.
| >
| >
|
| If I put in client code
|
| IDictionary props = ChannelServices.GetChannelSinkProperties(proxy);
| props["username"] = "dummyremotinguser";
| props["password"] = "12345";
|
| and then I call proxy.Method()
|
| on the server side in host on IIS (where do I set basic authentication) I
got:
|
| IPrincipal principal = System.Web.HttpContext.Current.User;
|
| here I want to perform custom authentication on LDAP or Database, the user
IS
| NOT AUTHENTICATED at this point, how do it? I need to know pasword too.
|

The client IS authenticated with IIS (and the SAM).

Anyway, what you are looking for is called - Kerberos Protocol Transition ,
a feature available in W2K3.

Start reading these for more detailed info:

http://msdn2.microsoft.com/fr-fr/library/ms131068.aspx
http://msdn.microsoft.com/library/de...ntechsuppl.asp
Willy.
Sep 5 '06 #5

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

Similar topics

7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
6
by: Magnus Jardeby | last post by:
I have a problem with basic authentication. I redirect a user from a page to another. I don't want to get the NT prompt login, I want the user to be logged in automatically. I want to send the...
2
by: Andrew | last post by:
The site is configured for anonymous access. One area is configured with basic authentication. When the user clicks on a menu item they will request an .asp file in the anonymous part of the site...
4
by: Joseph | last post by:
I have an intranet application that I setup using windows authentication through IIS basic authentication. Is there a way to set a timeout, so that after ten minutes the user will be prompted...
6
by: Erez Shor | last post by:
Hi, I need to build and asp page which access a remote windows server's registry and create a registry key. In order for the ASP page to be able to access the registry on the remote server I need...
13
by: Pete | last post by:
I'm cross posting from mscom.webservices.general as I have received no answer there: There has been a number of recent posts requesting how to satisfactorily enable BASIC authorization at the...
2
by: Dan Lenski | last post by:
Hi all, I've got a very simple HTML proxy server to access the web from my cell phone (based on this code: http://www.okisoft.co.jp/esc/python/proxy/). It's a very retarded phone that freezes if...
0
by: =?Utf-8?B?S29uc3RhbnRpbg==?= | last post by:
I am currently working on the application that need to simulate basic authentication programmatically using user's credentials that are known. Basically, the need is for a single sign on with a...
0
by: =?Utf-8?B?SGVybWFu?= | last post by:
My environment is as follows: IIS 6.0, Asp.Net 2.0, Windows 2003 Server. I am trying to create a single sign on SSO environment with C# and log into a site that is running Apache Server using...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.