Form-based authentication with Azure AD.
-
Create an Azure AD using the portal
-
Create a user:
az ad user create \
--display-name 'User 1' \
--password 'Str0ngP@ssw0rd' \
--user-principal-name 'user1@<yourfulldomain>'
- Register your application:
az ad app create \
--display-name mywebapp \
--reply-urls 'http://localhost:5000/signin-oidc'
--oauth2-allow-implicit-flow true
- Edit the
appsettings.json
and add the application paremeters:
"Domain": "",
"TenantId": "",
"ClientId": "",
-
Install .NET Core SDK
-
Run the app
dotnet restore
dotnet run
Command used to create the MVC App:
dotnet new mvc --auth SingleOrg \
--client-id '<client_id>' \
--tenant-id '<tenant_id>' \
--domain '<domain>'