Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

windows authentication in win 8 apps

Tags:

c#

xaml

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

like image 706
Mahadev Swamy Avatar asked Mar 10 '26 02:03

Mahadev Swamy


2 Answers

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 !

like image 65
Surender Singh Malik Avatar answered Mar 12 '26 16:03

Surender Singh Malik


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.

like image 33
Dai Avatar answered Mar 12 '26 14:03

Dai