ASP.NET Core MVC - Windows Authentication - asp.net-core

I have a general question about using Windows authentication in an ASP.NET Core MVC project.
As far as I could understand is that you can have the authentication based on the Windows user. If I would deploy the website and different clients would connect to the website, would I be able to get all the windows user names that are connecting to the page? And also would they also see different content if I would program the content based on the Windows user that is connecting?
Thanks

Related

How can I use Windows Authentication with Blazor WebAssembly and ASP.NET Core server?

There seem to be plenty of tutorials on how to use third-party authentication providers for Blazor WebAssembly, but there doesn't seem to be a documented process for using Windows Authentication (on-site Active Directory domain) from an ASP.NET Core hosted server.
Is this actually possible? I would like the Core server to authenticate the user with the roles and policies, and for this information to be accessible from the WebAssembly client also. I understand that the Client can only use authentication to show/hide UI elements, and that any actual securing should be done on the Server, but is there a way to access the Windows authentication/authorization from both sides of the application?

.Net 4.6 equivalent of .NET Core Identity password hashing

I have a requirement where I need to be able to create a user via a ASP.NETCore based web application and also via a windows application(.NET 4.6). The same user could be used to login to both the Web Site and the WindowsApp. The credential store used is a SQL Server database. I am using ASP.NET Core Identity with the default PasswordHashing implementation for the Web Application. But the problem that I am having is in trying to replicate the same PasswordHashing algorithm when creating users via the WindowsApplication. What is the easiest way to achieve this?
You can configure the ASP.NET Core Identity PasswordHashing implementation to use the V2 version - thus aligning with the behaviour of Identity 2 (that I'm guessing you're using in the .NET framework Windows app).
In the startup.cs of the web application, add this line:
services.Configure<PasswordHasherOptions>(options => options.CompatibilityMode = PasswordHasherCompatibilityMode.IdentityV2);
All passwords created through web will have to be reset.

ASP.NET Web API Authentication (Web + Mobile)

I'm designing a solution that involves ASP.NET Web API as the service layer plus clients for web, iOS and Android.
Web users should be able to log into the web site and do their stuff. I'm using Forms Authentication for this scenario.
Mobile users should use the REST API and I believe we need a different authentication mechanism here.
Assuming that a given ASP.NET MVC application can support only 1 authentication mode, do I need to create 2 separate applications, one as the web client with Forms Authentication, and one as the API, and host them separately?
Any advice would be appreciated.
You could do basic authentication for the service clients and combine that with your existing forms auth
http://leastprivilege.com/2012/10/23/mixing-mvc-forms-authentication-and-web-api-basic-authentication/

Users authentication in asp.net mvc 4 application on azure

I'm building a website from scratch using ASP.NET MVC 4.
The application is hosted on Windows Azure.
It's a rather basic website application.
Next, I would like to authenticate my users.
The authentication requirements are, again, rather basic and straight forward.
I did some reading, and it seems that the best two options for me to achieve users authentication are:
1. ASP.NET SimpleMembership
2. Windows Azure Active Directory Access Control
Now, my questions are, which one should I choose? which one is more secured?
It is dependent on what you want. WAAD -ACS gives you option to integrate various identity providers like google,yahoo etc or federate with Active directory services.
But if do not want such options and simply use your existing asp.net membership you can do that as well.

Web Service on Windows Azure?

I am new to Windows Azure and I have a question.
I have:
Web site which deployed to Windows Azure - The web site manage a table (add, edit, delete). I used this guide: Deploying an ASP.NET Web Application to a Windows Azure Web Site and SQL Database
Andorid application & iOS Application (Native Code).
Now, I want the mobile applications to get data (in JSON format) from the web site (and from the DB).
What is the best practice to do that?
I tried to create a Azure (WCF) Service (the project refrenced to the web site project) but I didn't succeded. If this is the way - Is anyone knows a good tutorial to do that?
Is there another option? Maybe from the web site itself?
Thank you very much,
Yuval
If you want to integrate with non-Microsoft technologies I suggest you take a look at the ASP.NET Web API which allows you to build REST services using content negotiation. Content negotiation allows your consumer to specify the format it requires (json, xml, ...).
To host the ASP.NET Web API in a Windows Azure Web Site you should take a look at Carlos' blog, he describes in detail what you need to do to make this work: Creating ASP.NET Web APIs on Azure Web Sites
Have you given ASP.NET Web API a look-see?
http://www.asp.net/web-api