How to get NT account in Silverlight?
Can anybody tell me how to get NT account's name using Silverlight? 开发者_开发技巧I know it easy to get a NT account in asp.net. But my Silverlight website is hosted in a html page.
Thanks.
Simply put - you don't. There is no concept of authentication until you call out to a web service that needs it, at that point identity will flow to the service. So you could have a service which returns the user name it's called with.
That would be a spammer's dream come true. MYDOMAIN\johndoe would give him enough info to come up with a valid email address of johndo@mydomain.com. So no, Silverlight won't let you access that information from a HTML-hosted application.
What you can do however, assuming your application is hosted on a page in the local intranet zone, is access the user name on the server and then pass it to the Silverlight application through the InitParams property.
精彩评论