Skip to content

Code samples for the DevUp conference presentation: Azure AD for devs - a primer

License

Notifications You must be signed in to change notification settings

KSchlobohm/devup-aad-for-devs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure AD for devs - a primer

Learn about Azure AD - Microsoft's cloud-scale identity platform. It can be tricky to figure out how auth works, but once you know it's a powerful tool in your toolbox. In this repository we'll learn how it's done in a .NET web app. We'll discover what app registrations are, why we need one and how to wire up auth between a web app and an API backend.

Getting Started

Run the app and observe the CRUD operations for TodListClient a .NET 7 ASP.NET Core MVC web app with a Web API backend that uses an in-memory dataset.

  1. Set multiple startup projects

    #image showing that two start up projects should be selected

    https://learn.microsoft.com/en-us/visualstudio/ide/how-to-set-multiple-startup-projects?view=vs-2022

  2. Start the solution and view the TodoList page

    #image of the todolist page

    You are now ready to use the demo script to learn about Azure AD App Registrations and the code changes needed to bring auth to your soltuion.

Additional resources

Tip #1 Use Azure AD Integration Assistant to check your settings

#image of the Azure AD integration assistant

Tip #2 Sample code for all your scenarios

#image of Azure AD Quickstart

And other Azure AD Sample projects

Tip #3 Debug App Registrations with authr.dev

#image of the authr.dev website

Tip #4 Compare App Registration Manifests (use that one that works)

#image of app registration manifest

Tip #5 Use IDownstreamAPI to make API calls without managing tokens

#image of the IDownstreamAPI in visual studio

Tip #6 IdentityModelEventSource.ShowPII might show a more helpful error message

#image of the IdentityModelEventSource property in code

Tip #7 Use host name preservation with reverse proxies

#image of invalid redirect issue related to host name preservatio

Tip #8 Sharing my experience

Troubleshooting

Tips for dealing with issues.

SocketException: No connection could be made... #image of runtime connection error

  • Configure the solution to set both web apps as startup projects.

About

Code samples for the DevUp conference presentation: Azure AD for devs - a primer

Resources

License

Stars

Watchers

Forks