Skip to content

Commit

Permalink
2010-03-03 Atsushi Enomoto <atsushi@ximian.com>
Browse files Browse the repository at this point in the history
	* HttpListenerContext.cs, HttpListener.cs :
	  support AuthenticationSchemeSelectorDelegate.


svn path=/trunk/mcs/; revision=152922
  • Loading branch information
atsushieno committed Mar 3, 2010
1 parent 0e5761c commit f334e6d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
9 changes: 7 additions & 2 deletions mcs/class/System/System.Net/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2010-03-03 Atsushi Enomoto <atsushi@ximian.com>

* HttpListenerContext.cs, HttpListener.cs :
support AuthenticationSchemeSelectorDelegate.

2010-03-01 Miguel de Icaza <miguel@novell.com>

* WebHeaderCollection.cs: Apply 2 year old patch from Yves Bastide
Expand All @@ -23,7 +28,7 @@

* IPEndPoint.cs: When throwing an ArgumentException in Create()
because of a mismatch in the address family, use a more informative
message. Patch by Juho Vähä-Herttu<juhovh@iki.fi>.
message. Patch by Juho Vaha-Herttu<juhovh@iki.fi>.
Fixes #505105.

2010-01-21 Sebastien Pouliot <sebastien@ximian.com>
Expand Down Expand Up @@ -286,7 +291,7 @@
Clear the ip_to_endpoints hashtable if there are no more prefixes
listening on that address.

2009-06-16 Andrés G. Aragoneses <aaragoneses@novell.com>
2009-06-16 Andres G. Aragoneses <aaragoneses@novell.com>

* WebConnection.cs: propagate the exception to the request.
* WebException.cs: new internal ctor.
Expand Down
8 changes: 4 additions & 4 deletions mcs/class/System/System.Net/HttpListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public AuthenticationSchemes AuthenticationSchemes {
}
}

//TODO: when is this called?
public AuthenticationSchemeSelector AuthenticationSchemeSelectorDelegate {
get { return auth_selector; }
set {
Expand Down Expand Up @@ -217,9 +216,10 @@ public HttpListenerContext EndGetContext (IAsyncResult asyncResult)
}

HttpListenerContext context = ares.GetContext ();
if (auth_schemes != AuthenticationSchemes.Anonymous) {
context.ParseAuthentication ();
}
if (AuthenticationSchemeSelectorDelegate != null)
context.ParseAuthentication (AuthenticationSchemeSelectorDelegate (context.Request));
else if (auth_schemes != AuthenticationSchemes.Anonymous)
context.ParseAuthentication (auth_schemes);
return context; // This will throw on error.
}

Expand Down
4 changes: 3 additions & 1 deletion mcs/class/System/System.Net/HttpListenerContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public IPrincipal User {
get { return user; }
}

internal void ParseAuthentication () {
internal void ParseAuthentication (AuthenticationSchemes expectedSchemes) {
if (expectedSchemes == AuthenticationSchemes.Anonymous)
return;
// TODO: Handle NTLM/Digest modes
string header = request.Headers ["Authorization"];

Expand Down

0 comments on commit f334e6d

Please sign in to comment.