2

I have a requirement to expose some WCF Web API to a 3rd party system. The 3rd party system may validate the users using Windows Authentication. My Web service will expose a Login method where the username is passed in. I need to authenticate the passed in user using Windows Authentication.

I try to determine the role for the user by using:

 Roles.GetRolesForUser(UserID)

I get the following error message: "Method is only supported if the user name parameter matches the user name in the current Windows Identity. "

How do I validate a passed in username using Windows Authentication?

4

1 回答 1

0

您必须先模拟用户,然后才能获得他/她的角色。或者无论如何都是具有足够访问权限的用户。

这是来自 Microsoft 的一个很好的参考资料,它解释了这一切:

http://msdn.microsoft.com/en-us/library/ff647405.aspx

于 2012-10-09T11:26:01.140 回答