Skip to content

Commit e70edd9

Browse files
committed
minor changes
1 parent 3204be5 commit e70edd9

File tree

4 files changed

+9
-27
lines changed

4 files changed

+9
-27
lines changed

articles/active-directory/external-identities/customers/how-to-single-page-application-react-prepare-app.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
---
22
title: Prepare a React single-page app (SPA) for authentication
3-
description: Learn how to prepare a React single-page app (SPA) for authentication and authorization with your Azure Active Directory (AD) for customers tenant.
3+
description: Learn how to prepare a React single-page app (SPA) for authentication with your Azure Active Directory (AD) for customers tenant.
44
services: active-directory
5-
author: godonnell
5+
author: garrodonnell
66
manager: celestedg
77
ms.service: active-directory
8-
ms.workload: identity
98
ms.subservice: ciam
109
ms.topic: how-to
1110
ms.date: 05/23/2023
1211
ms.author: godonnell
13-
ms.custom: it-pro
1412

15-
#Customer intent: As a dev, devops, or IT admin, enable authentication in my own React
13+
#Customer intent: As a dev, devops, or IT admin, I want to learn how to enable authentication in my own React single-page app
1614
---
1715
# Prepare a React single-page app (SPA) for authentication
1816

19-
After registration is complete, a React project can be created using an integrated development environment (IDE). This tutorial demonstrates how to create a React single-page app using npm and create files needed for authentication and authorization.
17+
After registration is complete, you can create a React project using an integrated development environment (IDE). This tutorial demonstrates how to create a React single-page app using npm and create files needed for authentication and authorization.
2018

2119
In this article, you learn how to:
2220

@@ -32,7 +30,6 @@ In this article, you learn how to:
3230
* [Node.js](https://nodejs.org/en/download/)
3331

3432
## Create a new React project
35-
3633
Use the following tabs to create a React project within the IDE.
3734

3835
1. Open Visual Studio Code, select **File** > **Open Folder...**. Navigate to and select the location in which to create your project.
@@ -46,7 +43,6 @@ Use the following tabs to create a React project within the IDE.
4643
```
4744
4845
## Install identity and bootstrap packages
49-
5046
Identity related **npm** packages must be installed in the project to enable user authentication. For project styling, **Bootstrap** will be used.
5147
5248
1. In the **Terminal** bar, select the **+** icon to create a new terminal. A separate terminal window will open with the previous node terminal continuing to run in the background.
@@ -58,7 +54,6 @@ Identity related **npm** packages must be installed in the project to enable use
5854
```
5955
6056
## Creating the authentication configuration file
61-
6257
1. In the *src* folder, create a new file called *authConfig.js*.
6358
1. Open *authConfig.js* and add the following code snippet:
6459
@@ -135,7 +130,6 @@ Identity related **npm** packages must be installed in the project to enable use
135130
136131
137132
## Modify index.js to include the authentication provider
138-
139133
All parts of the app that require authentication must be wrapped in the [`MsalProvider`](/javascript/api/@azure/msal-react/#@azure-msal-react-msalprovider) component. You instantiate a [PublicClientApplication](/javascript/api/@azure/msal-browser/publicclientapplication) then pass it to `MsalProvider`.
140134
141135
1. In the *src* folder, open *index.js* and replace the contents of the file with the following code snippet to use the `msal` packages and bootstrap styling:

articles/active-directory/external-identities/customers/how-to-single-page-application-react-prepare-tenant.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: Prepare your tenant to use a React single-page app (SPA) for authentication.
2+
title: Prepare your customer tenant to authenticate users in a React single-page app (SPA)
33
description: Learn how to configure your Azure Active Directory (AD) for customers tenant for authentication with a React single-page app (SPA).
44
services: active-directory
5-
author: godonnell
5+
author: garrodonnell
66
manager: celestedg
77
ms.service: active-directory
88
ms.workload: identity
@@ -14,7 +14,7 @@ ms.custom: it-pro
1414

1515
#Customer intent: As a dev I want to prepare my customer tenant for building a single-page app (SPA) with React
1616
---
17-
# Prepare your customer tenant for building a single-page app (SPA)
17+
# Prepare your customer tenant to authenticate users in a React single-page app (SPA)
1818

1919
Before your applications can interact with Microsoft identity platform they must be registered in a customer tenant that you manage and must be associated with a user flow.
2020

articles/active-directory/external-identities/customers/how-to-single-page-application-react-sample.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ author: garrodonnell
66
manager: celestedg
77
ms.author: godonnell
88
ms.service: active-directory
9-
ms.workload: identity
109
ms.subservice: ciam
1110
ms.topic: how-to
1211
ms.date: 05/23/2023

articles/active-directory/external-identities/customers/how-to-single-page-application-react-sign-in-out.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Sign in users with a React single-page-application
2+
title: Add sign-in to a React single-page app (SPA)
33
description: Learn how to configure a React single-page app (SPA) to sign in and sign out users with your Azure Active Directory (AD) for customers tenant.
44
services: active-directory
55
author: godonnell
@@ -15,8 +15,7 @@ ms.custom: it-pro
1515
#Customer intent: As a developer I want to add sign-in and sign-out functionality to my React single-page app
1616
---
1717

18-
# Create components for sign in and sign out in a React single page app
19-
18+
# Add sign-in to a React single-page app (SPA)
2019
Functional components are the building blocks of React apps. This tutorial demonstrates how functional components can be used to build the sign in and sign out experience in a React single-page app (SPA). The `useMsal` hook is used to retrieve an access token to allow user sign in.
2120

2221
In this tutorial:
@@ -42,8 +41,6 @@ In this tutorial:
4241
- *SignInButton.jsx*
4342
- *SignOutButton.jsx*
4443

45-
---
46-
4744
Once complete, you should have the following folder structure.
4845

4946
```txt
@@ -58,7 +55,6 @@ reactspalocal/
5855
```
5956

6057
### Adding the page layout
61-
6258
1. Open *PageLayout.jsx* and add the following code to render the page layout. The [useIsAuthenticated](/javascript/api/@azure/msal-react) hook returns whether or not a user is currently signed-in.
6359

6460
```javascript
@@ -110,7 +106,6 @@ reactspalocal/
110106
1. Save the file.
111107

112108
### Adding the sign in experience
113-
114109
1. Open *SignInButton.jsx* and add the following code, which creates a button that signs in the user using either a pop-up or redirect.
115110

116111
```javascript
@@ -163,7 +158,6 @@ reactspalocal/
163158
1. Save the file.
164159

165160
### Adding the sign out experience
166-
167161
1. Open *SignOutButton.jsx* and add the following code, which creates a button that signs out the user using either a pop-up or redirect.
168162

169163
```javascript
@@ -210,7 +204,6 @@ reactspalocal/
210204
```
211205

212206
## Change filename and add required imports
213-
214207
By default, the application runs via a JavaScript file called *App.js*. It needs to be renamed to *App.jsx*, which is an extension that allows a developer to write HTML in React.
215208

216209
1. Rename App.js to App.jsx.
@@ -230,7 +223,6 @@ By default, the application runs via a JavaScript file called *App.js*. It needs
230223
```
231224

232225
### Replacing the default function to render authenticated information
233-
234226
The following code will render based on whether the user is authenticated or not. Replace the default function `App()` to render authenticated information with the following code:
235227

236228
```javascript
@@ -267,7 +259,6 @@ export default function App() {
267259
```
268260

269261
## Run your project and sign in
270-
271262
All the required code snippets have been added, so the application can now be called and tested in a web browser.
272263

273264
1. Open a new terminal by selecting **Terminal** > **New Terminal**.
@@ -285,12 +276,10 @@ All the required code snippets have been added, so the application can now be ca
285276
1. The app will now ask for permission to sign-in and access data. Select **Accept** to continue.
286277
287278
## Sign out of the application
288-
289279
1. To sign out of the application, select **Sign out** in the navigation bar.
290280
1. A window appears asking which account to sign out of.
291281
1. Upon successful sign out, a final window appears advising you to close all browser windows.
292282
293283
## Next steps
294-
295284
> [!div class="nextstepaction"]
296285
> [Enable self-service password reset](./how-to-enable-password-reset-customers.md)

0 commit comments

Comments
 (0)