Search code examples
uwpimpersonation

How do you do Impersonation in UWP?


I am working on UWP application. A scenario came where i want to change the current context user(current login user).For that i am trying to implement Impersonation in UWP. In general windows or web application I am able to change the current context user by using sample code available on following link: http://www.codeproject.com/Articles/10090/A-small-C-Class-for-impersonating-a-User But i am unable to implement this in UWP. I want to implement impersonation in UWP.


Solution

  • Impersonation is not available for UWP applications. They are all tied to the current session user with only a restricted set of authorizations.

    The LogonUser API used to impersonate is only available to desktop/win32 apps.

    You can check the list of all the supported Win32 API in UWP here.