I am developing a C# WPF application that needs to authorize the current user based on their Windows domain logon. The user is not expected to enter his username/password, the application just authorizes him as long as his user account is running the app.
I achieve this by simply querying the current user's credentials using System.Security.Principal
like this:
System.Security.Principal.WindowsIdentity CallerWindowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent();
string username = CallerWindowsIdentity.Name;
// Then, I simply look up the username in my database
The problem: today my client has asked me to make it compliant with users from ADFS (Active Directory Federation Services) and Azure Active Directory.
I'm a bit of an old school coder. My knowledge has been around on-premise Windows Server Active Directory.
Would my code be compliant with these new technologies? Or do I have to redo the logon mechanism?