Skip to content

Commit 719e410

Browse files
UI - rename env variable names
1 parent 74c23f8 commit 719e410

7 files changed

Lines changed: 33 additions & 42 deletions

File tree

docs/ConfigureAppAuthentication.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ We will add Microsoft Entra ID as an authentication provider to API and Web Appl
6161
3. Grab Scope Name for Impersonation
6262

6363
- Select **Expose an API** in the left menu. Copy the Scope name, then paste it in some temporary place.
64-
The copied text will be used for Web Application Environment variable - **APP_MSAL_AUTH_SCOPE**.
64+
The copied text will be used for Web Application Environment variable - **APP_WEB_SCOPE**.
6565
![configure_app_registration_web_9](./Images/configure_app_registration_web_9.png)
6666

6767
4. Grab Client Id for Web App
6868

6969
- Select **Overview** in the left menu. Copy the Client Id, then paste it in some temporary place.
70-
The copied text will be used for Web Application Environment variable - **APP_MSAL_AUTH_CLIENT_ID**.
70+
The copied text will be used for Web Application Environment variable - **APP_WEB_CLIENT_ID**.
7171
![configure_app_registration_web_10](./Images/configure_app_registration_web_10.png)
7272

7373
## Step 3: Configure Application Registration - API Application
@@ -78,7 +78,7 @@ We will add Microsoft Entra ID as an authentication provider to API and Web Appl
7878
![configure_app_registration_api_1](./Images/configure_app_registration_api_1.png)
7979

8080
- Select **Expose an API** in the left menu. Copy the Scope name, then paste it in some temporary place.
81-
The copied text will be used for Web Application Environment variable - **APP_MSAL_TOKEN_SCOPE**.
81+
The copied text will be used for Web Application Environment variable - **APP_API_SCOPE**.
8282
![configure_app_registration_api_2](./Images/configure_app_registration_api_2.png)
8383

8484
## Step 4: Add Web Application's Client Id to Allowed Client Applications List in API Application Registration
@@ -100,7 +100,7 @@ Now, we will edit and deploy the Web Application Container with updated Environm
100100

101101
1. Select **Containers** menu under **Application**. Then click **Environment variables** tab.
102102
![update_env_app_1_1](./Images/update_env_app_1_1.png)
103-
2. Update 3 values which were taken in previous steps for **APP_MSAL_AUTH_CLIENT_ID**, **APP_MSAL_AUTH_SCOPE**, **APP_MSAL_TOKEN_SCOPE**.
103+
2. Update 3 values which were taken in previous steps for **APP_WEB_CLIENT_ID**, **APP_WEB_SCOPE**, **APP_API_SCOPE**.
104104
Click on **Save as a new revision**.
105105
The updated revision will be activated soon.
106106

infra/container_app/deploy_container_app_api_web.bicep

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,23 @@ module containerAppWeb 'deploy_container_app.bicep' = {
131131
value: containerAppApiEndpoint
132132
}
133133
{
134-
name: 'APP_MSAL_AUTH_CLIENT_ID'
134+
name: 'APP_WEB_CLIENT_ID'
135135
value: '<APP_REGISTRATION_CLIENTID>'
136136
}
137137
{
138-
name: 'APP_MSAL_AUTH_AUTHORITY'
138+
name: 'APP_WEB_AUTHORITY'
139139
value: '${environment().authentication.loginEndpoint}/${tenant().tenantId}'
140140
}
141141
{
142-
name: 'APP_MSAL_AUTH_SCOPE'
142+
name: 'APP_WEB_SCOPE'
143143
value: '<FRONTEND_API_SCOPE>'
144144
}
145145
{
146-
name: 'APP_MSAL_TOKEN_SCOPE'
146+
name: 'APP_API_SCOPE'
147147
value: '<BACKEND_API_SCOPE>'
148148
}
149149
{
150-
name: 'APP_ISLOGS_ENABLED'
150+
name: 'APP_CONSOLE_LOG_ENABLED'
151151
value: 'false'
152152
}
153153
]

infra/main.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,23 +2392,23 @@
23922392
"value": "[parameters('containerAppApiEndpoint')]"
23932393
},
23942394
{
2395-
"name": "APP_MSAL_AUTH_CLIENT_ID",
2395+
"name": "APP_WEB_CLIENT_ID",
23962396
"value": "<APP_REGISTRATION_CLIENTID>"
23972397
},
23982398
{
2399-
"name": "APP_MSAL_AUTH_AUTHORITY",
2399+
"name": "APP_WEB_AUTHORITY",
24002400
"value": "[format('{0}/{1}', environment().authentication.loginEndpoint, tenant().tenantId)]"
24012401
},
24022402
{
2403-
"name": "APP_MSAL_AUTH_SCOPE",
2403+
"name": "APP_WEB_SCOPE",
24042404
"value": "<FRONTEND_API_SCOPE>"
24052405
},
24062406
{
2407-
"name": "APP_MSAL_TOKEN_SCOPE",
2407+
"name": "APP_API_SCOPE",
24082408
"value": "<BACKEND_API_SCOPE>"
24092409
},
24102410
{
2411-
"name": "APP_ISLOGS_ENABLED",
2411+
"name": "APP_CONSOLE_LOG_ENABLED",
24122412
"value": "false"
24132413
}
24142414
]
@@ -3915,23 +3915,23 @@
39153915
"value": "[parameters('containerAppApiEndpoint')]"
39163916
},
39173917
{
3918-
"name": "APP_MSAL_AUTH_CLIENT_ID",
3918+
"name": "APP_WEB_CLIENT_ID",
39193919
"value": "<APP_REGISTRATION_CLIENTID>"
39203920
},
39213921
{
3922-
"name": "APP_MSAL_AUTH_AUTHORITY",
3922+
"name": "APP_WEB_AUTHORITY",
39233923
"value": "[format('{0}/{1}', environment().authentication.loginEndpoint, tenant().tenantId)]"
39243924
},
39253925
{
3926-
"name": "APP_MSAL_AUTH_SCOPE",
3926+
"name": "APP_WEB_SCOPE",
39273927
"value": "<FRONTEND_API_SCOPE>"
39283928
},
39293929
{
3930-
"name": "APP_MSAL_TOKEN_SCOPE",
3930+
"name": "APP_API_SCOPE",
39313931
"value": "<BACKEND_API_SCOPE>"
39323932
},
39333933
{
3934-
"name": "APP_ISLOGS_ENABLED",
3934+
"name": "APP_CONSOLE_LOG_ENABLED",
39353935
"value": "false"
39363936
}
39373937
]

src/ContentProcessorWeb/.env

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
REACT_APP_API_BASE_URL=APP_API_BASE_URL
22

3-
REACT_APP_MSAL_AUTH_CLIENT_ID = APP_MSAL_AUTH_CLIENT_ID
4-
REACT_APP_MSAL_AUTH_AUTHORITY = APP_MSAL_AUTH_AUTHORITY
3+
REACT_APP_WEB_CLIENT_ID = APP_WEB_CLIENT_ID
4+
REACT_APP_WEB_AUTHORITY = APP_WEB_AUTHORITY
55

6-
REACT_APP_MSAL_REDIRECT_URL = "/"
6+
REACT_APP_REDIRECT_URL = "/"
77

8-
REACT_APP_MSAL_POST_REDIRECT_URL = "/"
8+
REACT_APP_POST_REDIRECT_URL = "/"
99

10-
REACT_APP_MSAL_AUTH_SCOPE = APP_MSAL_AUTH_SCOPE
10+
REACT_APP_WEB_SCOPE = APP_WEB_SCOPE
1111

12-
REACT_APP_MSAL_TOKEN_SCOPE = APP_MSAL_TOKEN_SCOPE
13-
REACT_APP_ISLOGS_ENABLED = APP_ISLOGS_ENABLED
12+
REACT_APP_API_SCOPE = APP_API_SCOPE
13+
REACT_APP_CONSOLE_LOG_ENABLED = APP_CONSOLE_LOG_ENABLED

src/ContentProcessorWeb/src/Hooks/useConsoleSuppression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useEffect } from "react";
33
// Custom hook to suppress console logs, warnings, and errors in localhost
44
const useConsoleSuppression = () => {
55
useEffect(() => {
6-
if (window.location.hostname !== "localhost" && process.env.REACT_APP_ISLOGS_ENABLED?.toLocaleLowerCase() != "true" ) {
6+
if (window.location.hostname !== "localhost" && process.env.REACT_APP_CONSOLE_LOG_ENABLED?.toLocaleLowerCase() != "true" ) {
77
// Save the original console methods
88
const originalConsoleError = console.error;
99
const originalConsoleWarn = console.warn;

src/ContentProcessorWeb/src/Pages/DefaultPage/index.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ import { updatePanelCollapse } from "../../store/slices/defaultPageSlice.ts";
1010

1111
import { makeStyles, Button } from "@fluentui/react-components";
1212

13-
import {
14-
bundleIcon,
15-
CalendarMonthFilled,
16-
CalendarMonthRegular,
17-
} from "@fluentui/react-icons";
18-
19-
const CalendarMonth = bundleIcon(CalendarMonthFilled, CalendarMonthRegular);
20-
2113
const Page: React.FC = () => {
2214

2315
const dispatch = useDispatch<AppDispatch>();
@@ -40,7 +32,6 @@ const Page: React.FC = () => {
4032
</Button>
4133
</div>
4234
<PanelLeft togglePanel={togglePanel} />
43-
4435
</div>
4536

4637
<div className={`panelCenter ${store.isCenterPanelCollapse ? 'collapse' : 'expand'}`}>

src/ContentProcessorWeb/src/msal-auth/msaConfig.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { Configuration, LogLevel } from '@azure/msal-browser';
33

44
export const msalConfig: Configuration = {
55
auth: {
6-
clientId: process.env.REACT_APP_MSAL_AUTH_CLIENT_ID as string,
7-
authority: process.env.REACT_APP_MSAL_AUTH_AUTHORITY,
8-
redirectUri: process.env.REACT_APP_MSAL_REDIRECT_URL as string,
9-
postLogoutRedirectUri: process.env.REACT_APP_MSAL_POST_REDIRECT_URL as string,
6+
clientId: process.env.REACT_APP_WEB_CLIENT_ID as string,
7+
authority: process.env.REACT_APP_WEB_AUTHORITY,
8+
redirectUri: process.env.REACT_APP_REDIRECT_URL as string,
9+
postLogoutRedirectUri: process.env.REACT_APP_POST_REDIRECT_URL as string,
1010
},
1111
cache: {
1212
cacheLocation: 'localStorage', // Use localStorage for persistent cache
@@ -25,8 +25,8 @@ export const msalConfig: Configuration = {
2525
},
2626
};
2727

28-
const loginScope = process.env.REACT_APP_MSAL_AUTH_SCOPE as string;
29-
const tokenScope = process.env.REACT_APP_MSAL_TOKEN_SCOPE as string;
28+
const loginScope = process.env.REACT_APP_WEB_SCOPE as string;
29+
const tokenScope = process.env.REACT_APP_API_SCOPE as string;
3030

3131
// console.log("loginScope", loginScope);
3232
// console.log("tokenScope", tokenScope);

0 commit comments

Comments
 (0)