Reputation: 131
I am developing a windows 8 app using c# and xaml. My app should be able to implement windows authentication so that it can allow the logged in user to launch the app. Can anyone help or give me a code snippet to solve this problem???
thanks in advance
Upvotes: 3
Views: 1267
Reputation: 295
To Enable Windows Authentication in windows 8 App
Go to Package.appxmanifest file.
Go to Capabilities tab. Check the Enterprise Authentication feature on the Page.
Include the Namespace using Windows.System.UserProfile; Eg to Use the Profile User Name : txtUserName.Text = await UserInformation.GetFirstNameAsync();
This is how you will get the details of the Windows Authentication user. Hope this helped you !
Upvotes: 3
Reputation: 155428
You can't do that. Windows 8 "Immersive" applications are sandboxed and have no access to Windows' own user management. In any event user passwords are hashed (a one-way transform), you can't read back the original passwords even if you had access to the SAM file.
If you want a user's Windows password you'll have to ask them up-front, but I gurantee no (intelligent) user would voluntarily agree to this, and chances are your application would be denied on the Windows app-store if you did submit it.
Upvotes: 1