> Hello ?....is anyone home ?
Philip, I'm "home", I'm just "not all there". ;-)
I'm only just picking up on WCF this past few weeks. Ironically, I just
mentioned your post to my manager last night, as proof that WCF can use the
Membership provider for authentication. I told him that your only problem
was not being able to find the current user, and that I thought you'd have
your answer by now.
Maybe we can help each other out. You may be able to save me a great deal of
time by posting links to documentation or articles you've found on using the
Membership provider with WCF. If you have a small project that reproduces
the problem, that would be great, too.
For my part, I need to be able to show how the Membership provider can work
in WCF, so I would take what you post as a starting point, and research the
problem from there, over the weekend, because I find WCF just _so_ exciting.

Signature
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Philip - 07 Mar 2008 21:55 GMT
http://msdn2.microsoft.com/en-us/library/ms731049.aspx
http://nayyeri.net/blog/use-asp-net-membership-and-role-providers-in-windows-com
munication-foundation/
Here are a couple of URLs on how to use the ASP.NET Membership Provider
within WCF.
Let me know if you need for me to pull together my WCF project....it is just
rather large.... so I would need to do some copy and paste activity. Keep in
mind.... the ASP.NET Membership Provider works fine within WCF....however I
am attempting to use the ASP.NETCompatibility attribute to gain access to the
Username....but no such luck.....Username is not visible. The Http Context
is there....but IsAuthenticated() == False.... and Username == string.empty.
I appreciate your help....this is critical for me....does not do me much
good if the ASP.NET Membership Provider works yet I do not work who the user
is....
Again...thanks.
Philip

Signature
Philip
> > Hello ?....is anyone home ?
>
[quoted text clipped - 14 lines]
> in WCF, so I would take what you post as a starting point, and research the
> problem from there, over the weekend, because I find WCF just _so_ exciting.
Adam.C.Main - 12 Mar 2008 18:17 GMT
Have you tried using System.Threading.Thread.CurrentPrincipal.Identity.Name?
I'm using membership providers for my WCF service authentication, and that
appears to be working for me. I need to do more extensive testing, but so
far so good.
-Adam
> http://msdn2.microsoft.com/en-us/library/ms731049.aspx
>
[quoted text clipped - 17 lines]
>
> Philip
Philip - 12 Mar 2008 19:28 GMT
Thank you very much for the info...
I will definitely try this.

Signature
Philip
> Have you tried using System.Threading.Thread.CurrentPrincipal.Identity.Name?
> I'm using membership providers for my WCF service authentication, and that
[quoted text clipped - 24 lines]
> >
> > Philip
Philip - 12 Mar 2008 20:06 GMT
Adam,
Good news...System.Threading.Thread.CurrentPrincipal.Identity.Name does
properly identify the authenticated Username. One other
note...System.Threading.Thread.CurrentPrincipal.Identity.Name does not work
when operating in AspNetCompatibility mode....returns zero length Username...
however in my case this is fine...I did not want to operate in
AspNetCompatibility mode anyway.
Thanks for your assistance.

Signature
Philip
> Thank you very much for the info...
>
[quoted text clipped - 28 lines]
> > >
> > > Philip