In order to actually determine Active Directory roles or obtain additional data on
the user in Active Directory, you would typically write a WCF service that accepts
an Active Directory username and whatever search credentials you want. The service
would return back additional Active Directory details. This sample is just a
quick and dirty way of retrieving the user's Active Directory username when they
try to access the folder the Silverlight application is hosted in. In most cases,
the user would have authenticated via Active Directory while logging into SharePoint.
Those credentials are automatically passed when they attempt to load your Silverlight
application hosted in the SharePoint Page.
Our GetActiveDirectoryUserName.aspx will return an empty string if your Silverlight
web site does not require windows authentication. So, make sure you disable anonymous
You can also accomplish this task by using a SharePoint WebPart that loads the part
via a url. In that instance, you could avoid the WebClient request and instead
put your Silverlight object tags in an aspx page. The aspx page could register