All Projects → Azure-Samples → Active Directory Dotnet Native Aspnetcore V2

Azure-Samples / Active Directory Dotnet Native Aspnetcore V2

Licence: mit
Calling a ASP.NET Core Web API from a WPF application using Azure AD v2.0

Projects that are alternatives of or similar to Active Directory Dotnet Native Aspnetcore V2

Poddycast
Podcast app made with Electron, lots of ❤️ and ☕️
Stars: ✭ 111 (-26.49%)
Mutual labels:  desktop-app
Chirp
🐦 A cross platform twitter application
Stars: ✭ 129 (-14.57%)
Mutual labels:  desktop-app
Responsively App
A modified web browser that helps in responsive web development. A web developer's must have dev-tool.
Stars: ✭ 14,425 (+9452.98%)
Mutual labels:  desktop-app
Bookmarks
a simple self-hosted bookmarking app that can import bookmarks from delicious and chrome
Stars: ✭ 112 (-25.83%)
Mutual labels:  desktop-app
Youtube Comment Suite
Download YouTube comments from numerous videos, playlists, and channels for archiving, general search, and showing activity.
Stars: ✭ 120 (-20.53%)
Mutual labels:  desktop-app
Flutter Ui Designs
Just collection of UI designs build with flutter. Can run on any mobile, web & desktop.
Stars: ✭ 131 (-13.25%)
Mutual labels:  desktop-app
Bookmark
[NOT MAINTAINED] Desktop app to manage bookmarked links using Atom Electron and Vue.js.
Stars: ✭ 97 (-35.76%)
Mutual labels:  desktop-app
Mootool
A handy tool set for developers. 开发者常备小工具
Stars: ✭ 141 (-6.62%)
Mutual labels:  desktop-app
Lambda Lantern
🧙 ‎‎ A 3D game about functional programming patterns. Uses PureScript Native, C++, and Panda3D.
Stars: ✭ 122 (-19.21%)
Mutual labels:  desktop-app
Notepanda
📃 A simple cross-platform notepad. Based on Qt and C++.
Stars: ✭ 134 (-11.26%)
Mutual labels:  desktop-app
Reactide
Reactide is the first dedicated IDE for React web application development.
Stars: ✭ 10,318 (+6733.11%)
Mutual labels:  desktop-app
Dualsub
DualSub: bilingual subtitles maker
Stars: ✭ 117 (-22.52%)
Mutual labels:  desktop-app
Elements
⚛⚗ A desktop App which displays the periodic table
Stars: ✭ 131 (-13.25%)
Mutual labels:  desktop-app
Google Allo For Desktop
A "native-like" OS X, Windows, & Linux desktop app for Google Allo
Stars: ✭ 112 (-25.83%)
Mutual labels:  desktop-app
Google Messages For Desktop
A "native-like" OS X, Windows, & Linux desktop app for Google Messages
Stars: ✭ 140 (-7.28%)
Mutual labels:  desktop-app
Active Directory Dotnet Daemon
A Windows console application that calls a web API using its app identity (instead of a user's identity) to get access tokens in an unattended job or process.
Stars: ✭ 107 (-29.14%)
Mutual labels:  desktop-app
Nikola
⚡Unofficial cross-platform desktop app to monitor and control Tesla vehicles, powered by Electron & React
Stars: ✭ 130 (-13.91%)
Mutual labels:  desktop-app
Raven Reader
📖 All your articles in one place. Beautiful.
Stars: ✭ 2,040 (+1250.99%)
Mutual labels:  desktop-app
Google Assistant Unofficial Desktop Client
A cross-platform unofficial Google Assistant Client for Desktop (powered by Google Assistant SDK)
Stars: ✭ 2,534 (+1578.15%)
Mutual labels:  desktop-app
Webapiclientgen
Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
Stars: ✭ 134 (-11.26%)
Mutual labels:  web-api

languages:

  • csharp products:
  • aspnet
  • azure
  • azure-active-directory page_type: sample urlFragment: active-directory-dotnet-native-aspnetcore-v2 description: "Protect an ASP.NET Core Web API with the Microsoft identity platform."

Protecting an ASP.NET Core Web API using Microsoft identity platform

Build status

About this sample

Scenario

In this scenario, we protect a web API using the Microsoft identity platform. This ensures that the web API is accessible only to authenticated users. In these samples, we work with apps that authenticate users using both Work and school accounts and personal Microsoft accounts (MSA).

We also enhance the web API to use the on-behalf-of flow to call other web APIs protected by the Microsoft identity platform.

Prerequisites

  • Install .NET Core for Windows by following the instructions at dot.net/core which includes Visual Studio 2019.
  • An Azure Active Directory (Azure AD) tenant. For more information on how to get an Azure AD tenant, see Quickstart: Set up a tenant
  • A user account in your Azure AD tenant, or a personal Microsoft account (MSA)

Step 1: Clone or download this repository

From your shell or command line:

git clone https://github.com/Azure-Samples/active-directory-dotnet-native-aspnetcore-v2.git

TIP: To avoid path length limitations on Windows, you may need to clone into a directory with a shorter name or near the root of your drive.

Structure of the repository

This repository contains a progressive tutorial made up of the following chapters. We recommend you follow the tutorial in the order presented, but you can try out individual chapters if you wish.

Subfolder Description
1. Desktop app calls a protected Web API In the first chapter, we protect an ASP.Net Core Web API using the Microsoft identity platform. The Web API will be protected using Azure Active Directory OAuth Bearer Authorization. The Web API is called by a .NET Desktop WPF application. In this chapter, the desktop application uses the Microsoft Authentication Library for .NET (MSAL.NET) to sign-in the user to acquire an Access Token for the protected Web API. Topology
2. Web API now calls Microsoft Graph In the second chapter we enhance the Web API to call Microsoft Graph using the on-behalf flow to represent the user signed-in in the desktop application to Microsoft Graph. In this chapter, the Web API uses the MSAL.NET to acquire an Access Token for Microsoft Graph using the on-behalf-of flow Topology
3. Web API and client share the same app id and signs-in MSA users In the third chapter, we present another pattern where a tightly-knit client and Web API share the same client id (app id). In this one we will sign-in users with Microsoft Personal Accounts. The sign-in flow and the call to Web API uses the same flow as chapter 2. Topology
4. Client app calls a Web API with Proof of Possession (PoP) In this chapter, the ASP.NET Core Web API is expecting an Access Token with a Proof of Possession key. Topology

We recommend that you start with chapter 1. Desktop app calls Web API, where you learn how to protect a web API with Azure AD.

Community Help and Support

Use Stack Overflow to get support from the community. Ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before. Tag your questions or comments with [msal dotnet].

If you find a bug in the sample, please open an issue on GitHub Issues.

To provide a recommendation, visit the following User Voice page.

Contributing

If you'd like to contribute to this sample, see CONTRIBUTING.MD.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Other samples and documentation

See also other samples where a client app calls your own web API:

Then for other samples and docs:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].