Azure-Samples / ms-identity-ciam-javascript-tutorial

CIAM JavaScript samples
MIT License
26 stars 37 forks source link

page_type: sample languages:

Tutorial: Enable your JavaScript application to sign-in users and call APIs with Microsoft Entra External ID

This tutorial aims to take you through the fundamentals of modern authentication with Microsoft Entra External ID, using the Microsoft Authentication Library for JavaScript.

Prerequisites

Please refer to each sample's README for sample-specific prerequisites.

The following tables are a summary of code samples alongside links to tutorials on how to integrate various app types with Microsoft Entra External ID:

Chapter 1: Sign-in a user to your application with Microsoft Entra External ID

Language/platform + app type Scenario GitHub code sample Explore and run code sample Build and integrate tutorial
VanillaJS SPA Sign in users with a Vanilla JavaScript SPA Sign in using a Vanilla JavaScript SPA Sign in users Sign in users
React SPA Sign in users with a React SPA Sign in using a React SPA Sign in users Sign in users
Angular SPA Sign in users with an Angular SPA Sign in using an Angular SPA Sign in users ---
Electron desktop app Sign in users with an Electron desktop app Sign in using an Electron desktop app Sign in users ---
Node.js browserless app Sign in users with a Node.js browserless app Sign in using a Node.js browserless app Sign in users Sign in users
Node.js & Express web app Sign in users with a Node.js & Express web app Sign in using a Node.js & Express web app Sign in users Sign in users

Chapter 2: Protect an API and call the API from your client app

The following table summarizes resources with guidance on how to protect your web API with the Microsoft Entra External ID. You then use a client application to sign-in a user, acquire an Access Token for your app to call the protected web API.

Language/platform + app type Scenario GitHub code sample Explore and run code sample Build and integrate tutorial
Node.js & Express web app Sign in users and call an API using a Node.js & Express web app Sign in users and call an API using a Node.js & Express web app Sign in users and call an API Sign in users and call an API
Node.js daemon application Call an API using a Node.js daemon application Call an API using a Node.js daemon application Call an API Call an API
Vanilla JavaScript SPA Sign in users and call an API using a Vanilla JavaScript SPA Sign in users and call an API using a Vanilla JavaScript SPA --- ---
React SPA Sign in users and call an API using a React SPA Sign in users and call an API using a React SPA --- ---
Angular SPA Sign in users and call an API using an Angular SPA Sign in users and call an API using an Angular SPA --- ---

If you're looking for more samples on different authentication and authorization scenarios, see Samples for External ID developers

More information

Learn more about the Microsoft Entra External ID for customers:

We'd love your feedback

Were we successful in addressing your learning objective? Consider taking a moment to share your experience with us.

Community help and support

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit cla.opensource.microsoft.com.

Code of conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.