- Challenge 4 - Run the app on Azure should be done successfully.
Right now your application on Azure is wide open for anyone to use. Your application allows you to add, edit and delete competitors. Let's make sure only authenticated users can do this. If you try to perform one of these actions in your application, you'll get some errors; you need to complete the feature!
The application has the code in place to authenticate users against Azure AD B2C, you just need to create an Azure AD B2C application, build the user journeys and policy and then set the right configuration values.
- Create an
Azure AD B2C
application in the Azure portal. - Allow users to authenticate with a
Microsoft Account
. - Make sure it works in your on Azure App Service
- DO NOT store credentials in your code or appsettings file.
- When a user hits the 'Sign In' link, they are redirected to login with a Microsoft Account.
- A user can successfully authenticate with an MSA, get redirected back to your application and see a personalized greeting (see below).
- A user can successfully add or edit a bot in the Competitor views.
- In Azure DevOps (Boards), from the Boards view, you could now drag and drop the user story associated to this Challenge to the
Resolved
orClosed
column, congrats! ;)
- Make sure you are calling the application with https for the authentication redirects to work.
- Remember to keep your configuration secrets OUT of your code or config files.
- If you can't find your AAD B2C Azure resources after you create them, make sure you switch AAD Tenants in the Azure portal.
- Don't forget
/signin-oidc
in your redirect URL :)
Too comfortable? Eager to do more? Try this:
- Allow users to authenticate with more than 1 Identity Provider. Try it with Facebook and LinkedIn too.
- Rather than relying on users to use their social logins, let them create their own accounts in your tenant.
- Get it to work in your dev environment NOTE: this will require getting an SSL Certificate and configuring HTTPS for your docker-machine
- Set up AAD B2C with a Microsoft Account - In step 6, you may to format the Redirect URL as:
https://login.microsoftonline.com/te/<your-tenant>.onmicrosoft.com/oauth2/authresp
- Working with Azure App Service Application Settings
- Cloud authentication with Azure Active Directory B2C in ASP.NET Core