Quickstart Native Authentication Single Page App Sdk Sign In
In brief
The quickstart for configuring React and Angular single-page apps with the native authentication JavaScript SDK was deleted, including setup guidance for sign-up, sign-in, sign-out, and password reset.
What Entra admins need to know
Review bookmarks and internal links that reference this quickstart; no configuration change or migration is specified.
This editorial summary was generated by AI from the documentation changes. Verify important details in the full Microsoft Learn article.
Documentation change
The comparison below shows only the changed extract. Use the full-page view for complete context.
deleted file mode 100644
title: Sign in users in a single-page app by using native authentication SDK
description: Configure a React single-page app with native authentication SDK to let users sign up, sign in, sign out, and reset passwords. Start with this quickstart.
manager: dougeby
ms.service: identity-platform
ms.subservice: external
ms.topic: quickstart
ms.date: 11/17/2025
#Customer intent: As a developer, I want to configure a sample single-page application using native authentication react SDK so that I can authenticate users, including sign-up, sign-in, sign-out, and password reset flows.
Quickstart: Sign in users in a single-page app by using native authentication JavaScript SDK
[!INCLUDE applies-to-external-only]
In this Quickstart, you use a single-page application (SPA) to demonstrate how to authenticate users by using native authentication SDK. The sample app demonstrates user sign-up, sign-in, and sign-out for both email with password and email one-time passcode authentication flows.
Prerequisites
An Azure account with an active subscription. If you don't already have one, Create an account for free.This Azure account must have permissions to manage applications. Any of the following Microsoft Entra roles include the required permissions:Application AdministratorApplication Developer
An external tenant. If you don't have one, create a new external tenant in the Microsoft Entra admin center.A user flow. For more information, see create self-service sign-up user flows for apps in external tenants. UnderIdentity providers, select your preferred method of authentication, that's,Email with passwordorEmail one-time passcode. For this code sample, use the following user attributes in your user flow as the sample app collects them from the user:Given NameSurnameJob TitleCountry/Region
If you haven't already done so, Register an application in the Microsoft Entra admin center. Make sure to:Record theApplication (client) IDandDirectory (tenant) IDfor later use.Grant admin consent to the app registration.
Associate your app registration with the user flowNode.js.Visual Studio Code or another code editor.
Enable public client and native authentication flows
[!INCLUDE Enable public client and native authentication]
Clone or download sample SPA
To obtain the sample application, you can either clone it from GitHub or download it as a .zip file.
To clone the sample, open a command prompt and navigate to where you wish to create the project, and enter the following command:git clone https://github.com/Azure-Samples/ms-identity-ciam-native-javascript-samples.gitDownload the sample. Extract it to a file path where the length of the name is fewer than 260 characters.
Install project dependencies
React
Open a terminal window and navigate to the directory that contains the React sample app:cd typescript/native-auth/react-nextjs-sampleRun the following command to install app dependencies:npm install
Angular
Open a terminal window and navigate to the directory that contains the React sample app:cd typescript/native-auth/angular-sampleRun the following command to install app dependencies:npm install
Configure the sample React app
React
Opensrc/config/auth-config.tsand replace the following placeholders with the values obtained from the Microsoft Entra admin center:Find the placeholderEnter_the_Application_Id_Herethen replace it with the Application (client) ID of the app you registered earlier.Find the placeholderEnter_the_Tenant_Subdomain_Herethen replace it with the tenant subdomain in your Microsoft Entra admin center. For example, if your tenant primary domain iscontoso.onmicrosoft.com, usecontoso. If you don't have your tenant name, learn how to read your tenant details.
Save the changes.
Angular
Opensrc/app/config/auth-config.tsand replace the following placeholders with the values obtained from the Microsoft Entra admin center:Find the placeholderEnter_the_Application_Id_Herethen replace it with the Application (client) ID of the app you registered earlier.Find the placeholderEnter_the_Tenant_Subdomain_Herethen replace it with the tenant subdomain in your Microsoft Entra admin center. For example, if your tenant primary domain iscontoso.onmicrosoft.com, usecontoso. If you don't have your tenant name, learn how to read your tenant details.
Save the changes.
Configure CORS proxy server
The native authentication API doesn't support Cross-Origin Resource Sharing (CORS) so you must set up a proxy server between your SPA app and the APIs.
This code sample includes a CORS proxy server that forwards requests to native authentication API URL endpoints. The CORS proxy server is a Node.js server that listens on port 3001.
To configure the proxy server, open the proxy.config.js file, then the find the placeholder:
tenantSubdomainand replace it with the Directory (tenant) subdomain. For example, if your tenant primary domain iscontoso.onmicrosoft.com, usecontoso. If you don't have your tenant subdomain, learn how to read your tenant details.tenantIdand replace it with the Directory (tenant) ID. If you don't have your tenant ID, learn how to read your tenant details.
Run and test your app
You've now configured the sample app and it's ready to run.
React
From your terminal window, run the following commands to start the CORS proxy server:cd typescript/native-auth/react-nextjs-sample/ npm run corsTo start your React app, open another terminal window, then run the following commands:cd typescript/native-auth/react-nextjs-sample/ npm run devOpen a web browser and go tohttp://localhost:3000/.To sign up for an account, selectSign Up, then follow the prompts.After you sign up, test sign-in and password reset by selectingSign InandReset Passwordbuttorespectively.
Angular
From your terminal window, run the following commands to start the CORS proxy server:cd typescript/native-auth/angular-sample/ npm run corsTo start your React app, open another terminal window, then run the following commands:cd typescript/native-auth/angular-sample/ npm run startOpen a web browser and go tohttp://localhost:4200.To sign up for an account, selectSign Up, then follow the prompts.After you sign up, test sign-in and password reset by selectingSign InandReset Passwordbuttorespectively.
Enable sign-in with an alias or username
[!INCLUDE Enable sign-in with an alias or username]
Related content
@@ -1,173 +0,0 @@-----title: Sign in users in a single-page app by using native authentication SDK-description: Configure a React single-page app with native authentication SDK to let users sign up, sign in, sign out, and reset passwords. Start with this quickstart.-manager: dougeby-ms.service: identity-platform-ms.subservice: external-ms.topic: quickstart-ms.date: 11/17/2025-#Customer intent: As a developer, I want to configure a sample single-page application using native authentication react SDK so that I can authenticate users, including sign-up, sign-in, sign-out, and password reset flows.------# Quickstart: Sign in users in a single-page app by using native authentication JavaScript SDK--[!INCLUDE [applies-to-external-only](../external-id/includes/applies-to-external-only.md)]--In this Quickstart, you use a single-page application (SPA) to demonstrate how to authenticate users by using native authentication SDK. The sample app demonstrates user sign-up, sign-in, and sign-out for both email with password and email one-time passcode authentication flows.--## Prerequisites--* An Azure account with an active subscription. If you don't already have one, [Create an account for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).-* This Azure account must have permissions to manage applications. Any of the following Microsoft Entra roles include the required permissions:- * Application Administrator- * Application Developer-* An external tenant. If you don't have one, [create a new external tenant](../external-id/customers/how-to-create-external-tenant-portal.md) in the Microsoft Entra admin center.-* A user flow. For more information, see [create self-service sign-up user flows for apps in external tenants](../external-id/customers/how-to-user-flow-sign-up-sign-in-customers.md). Under **Identity providers**, select your preferred method of authentication, that's, **Email with password** or **Email one-time passcode**. For this code sample, use the following user attributes in your user flow as the sample app collects them from the user:- * **Given Name**- * **Surname**- * **Job Title**- * **Country/Region**-* If you haven't already done so, [Register an application in the Microsoft Entra admin center](quickstart-register-app.md). Make sure to:- * Record the **Application (client) ID** and **Directory (tenant) ID** for later use.- * [Grant admin consent](quickstart-register-app.md#grant-admin-consent-external-tenants-only) to the app registration.-* [Associate your app registration with the user flow](/entra/external-id/customers/how-to-user-flow-add-application)-* [Node.js](https://nodejs.org/en/download/).-* [Visual Studio Code](https://code.visualstudio.com/download) or another code editor.--## Enable public client and native authentication flows --[!INCLUDE [Enable public client and native authentication](../external-id/customers/includes/native-auth/enable-native-authentication.md)]--## Clone or download sample SPA--To obtain the sample application, you can either clone it from GitHub or download it as a .zip file.--- To clone the sample, open a command prompt and navigate to where you wish to create the project, and enter the following command:-- ```console- git clone https://github.com/Azure-Samples/ms-identity-ciam-native-javascript-samples.git- ```--- [Download the sample](https://github.com/Azure-Samples/ms-identity-ciam-native-javascript-samples/archive/refs/heads/main.zip). Extract it to a file path where the length of the name is fewer than 260 characters. --## Install project dependencies--#### [React](#tab/react)--1. Open a terminal window and navigate to the directory that contains the React sample app:-- ```console- cd typescript/native-auth/react-nextjs-sample- ```-1. Run the following command to install app dependencies:-- ```console- npm install- ```--#### [Angular](#tab/angular)--1. Open a terminal window and navigate to the directory that contains the React sample app:-- ```console- cd typescript/native-auth/angular-sample- ```-1. Run the following command to install app dependencies:-- ```console- npm install- ```------## Configure the sample React app--#### [React](#tab/react)--1. Open *src/config/auth-config.ts* and replace the following placeholders with the values obtained from the Microsoft Entra admin center:-- * Find the placeholder `Enter_the_Application_Id_Here` then replace it with the Application (client) ID of the app you registered earlier.- * Find the placeholder `Enter_the_Tenant_Subdomain_Here` then replace it with the tenant subdomain in your Microsoft Entra admin center. For example, if your tenant primary domain is `contoso.onmicrosoft.com`, use `contoso`. If you don't have your tenant name, learn how to [read your tenant details](../external-id/customers/how-to-create-external-tenant-portal.md#get-the-external-tenant-details). --1. Save the changes.--#### [Angular](#tab/angular)---1. Open *src/app/config/auth-config.ts* and replace the following placeholders with the values obtained from the Microsoft Entra admin center:-- * Find the placeholder `Enter_the_Application_Id_Here` then replace it with the Application (client) ID of the app you registered earlier.- * Find the placeholder `Enter_the_Tenant_Subdomain_Here` then replace it with the tenant subdomain in your Microsoft Entra admin center. For example, if your tenant primary domain is `contoso.onmicrosoft.com`, use `contoso`. If you don't have your tenant name, learn how to [read your tenant details](../external-id/customers/how-to-create-external-tenant-portal.md).--1. Save the changes.-------## Configure CORS proxy server--The native authentication API doesn't support [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/docs/Web/HTTP/CORS) so you must set up a proxy server between your SPA app and the APIs.--This code sample includes a CORS proxy server that forwards requests to native authentication API URL endpoints. The CORS proxy server is a Node.js server that listens on port 3001.--To configure the proxy server, open the *proxy.config.js* file, then the find the placeholder:--- `tenantSubdomain` and replace it with the Directory (tenant) subdomain. For example, if your tenant primary domain is `contoso.onmicrosoft.com`, use `contoso`. If you don't have your tenant subdomain, learn how to [read your tenant details](../external-id/customers/how-to-create-external-tenant-portal.md#get-the-external-tenant-details).-- `tenantId` and replace it with the Directory (tenant) ID. If you don't have your tenant ID, learn how to [read your tenant details](../external-id/customers/how-to-create-external-tenant-portal.md#get-the-external-tenant-details).--## Run and test your app--You've now configured the sample app and it's ready to run.--#### [React](#tab/react)--1. From your terminal window, run the following commands to start the CORS proxy server:-- ```console- cd typescript/native-auth/react-nextjs-sample/- npm run cors- ```--1. To start your React app, open another terminal window, then run the following commands:-- ```console- cd typescript/native-auth/react-nextjs-sample/- npm run dev- ```--1. Open a web browser and go to `http://localhost:3000/`.--1. To sign up for an account, select **Sign Up**, then follow the prompts.--1. After you sign up, test sign-in and password reset by selecting **Sign In** and **Reset Password** buttorespectively.--#### [Angular](#tab/angular)--1. From your terminal window, run the following commands to start the CORS proxy server:-- ```console- cd typescript/native-auth/angular-sample/- npm run cors- ```--1. To start your React app, open another terminal window, then run the following commands:-- ```console- cd typescript/native-auth/angular-sample/- npm run start- ```--1. Open a web browser and go to `http://localhost:4200`.--1. To sign up for an account, select **Sign Up**, then follow the prompts.--1. After you sign up, test sign-in and password reset by selecting **Sign In** and **Reset Password** buttorespectively.-------## Enable sign-in with an alias or username--[!INCLUDE [Enable sign-in with an alias or username](./includes/native-auth-api/enable-username-signin.md)]--## Related content--- [Build a React single-page app that uses native authentication SDK to authenticate users](tutorial-native-authentication-single-page-app-react-sdk-sign-up.md).-- [Build your Angular single-page app that uses native authentication SDK to authenticate users](tutorial-native-authentication-single-page-app-angular-sign-up.md).\ No newline at end of file 