6

How can get in ASP.NET user name and password from URL?

https://myUser:myPassword@myServer/

HttpContext.Current.Request.Url is returning https://myServer/.

2 Answers 2

5

You need to access the authentication headers.

Info about HTTP Authentication: http://en.wikipedia.org/wiki/Basic_access_authentication

Implementing it in asp.net: http://blog.smithfamily.dk/2008/08/27/ImplementingBasicAuthenticationInASPNET20.aspx

Sign up to request clarification or add additional context in comments.

1 Comment

The second link on this is broke.
0

Actually, it's perfectly possible to have URI credentials in the URL without a HTTP Authorization header. To pull those out, since the Request.Url property is a Uri object, you can access those details in the Uri.UserInfo property.

1 Comment

It seems that IIS is not passing UserInfo to HttpContext.Current.Request.Url.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.