You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 3, 2024. It is now read-only.
* We render the SPA code that was acquired server-side, and provide it to the acquireTokenByCode API on the MSAL.js PublicClientApplication instance.
34
+
* The application should also render any account hints, as they will be needed for any interactive requests to ensure the same user is used for both requests.
35
+
* For more information about using loginHint and sid, visit:
Copy file name to clipboardExpand all lines: 6-AdvancedScenarios/4-hybrid-SPA/AppCreationScripts/Configure.ps1
+2-1
Original file line number
Diff line number
Diff line change
@@ -196,7 +196,7 @@ Function ConfigureApplications
196
196
} `
197
197
-Spa `
198
198
@{ `
199
-
RedirectUris="http://localhost:5000"
199
+
RedirectUris="http://localhost:5000";
200
200
} `
201
201
-SignInAudience AzureADMyOrg `
202
202
#end of command
@@ -315,6 +315,7 @@ Function ConfigureApplications
315
315
Write-Host"- For service"
316
316
Write-Host" - Navigate to $servicePortalUrl"
317
317
Write-Host" - Navigate to the Manifest page, find the property 'accessTokenAcceptedVersion' and set it to '2'"-ForegroundColor Red
318
+
Write-Host" - Navigate to the Manifest page, find the 'optionalClaims' section and change its default value to request 'idToken' claims"-ForegroundColor Red
318
319
Write-Host-ForegroundColor Green "------------------------------------------------------------------------------------------------"
Copy file name to clipboardExpand all lines: 6-AdvancedScenarios/4-hybrid-SPA/README.md
+77-37
Original file line number
Diff line number
Diff line change
@@ -171,6 +171,28 @@ The first thing that we need to do is to declare the unique [resource](https://d
171
171
* Select the **Add scope** button on the bottom to save this scope.
172
172
1. Select the `Manifest` blade on the left.
173
173
* Set `accessTokenAcceptedVersion` property to **2**.
174
+
* Set the `optionalClaims` property as shown below to request client capabilities claim `idToken`:
175
+
```json
176
+
"optionalClaims": {
177
+
"idToken": [
178
+
{
179
+
"name": "sid",
180
+
"source": null,
181
+
"essential": false,
182
+
"additionalProperties": []
183
+
},
184
+
{
185
+
"name": "login_hint",
186
+
"source": null,
187
+
"essential": false,
188
+
"additionalProperties": []
189
+
}
190
+
],
191
+
"accessToken": [],
192
+
"saml2Token": []
193
+
}
194
+
```
195
+
174
196
* Click on **Save**.
175
197
176
198
#### Configure the service app (msal-hybrid-spa) to use your app registration
@@ -252,28 +274,43 @@ Next, parse the authorization code, and invoke the acquireTokenByCode API on the
252
274
253
275
When invoking this API, set enableSpaAuthorizationCode to true, which will enable MSAL to acquire a second authorization code to be redeemed by your single-page application.
254
276
277
+
Your application should parse this second authorization code, as well as any account hints (e.g. sid, login_hint, preferred_username) and return them such that they can be rendered client-side:
Next, render the code that was acquired server-side, and provide it to the acquireTokenByCode API on the MSAL.js PublicClientApplication instance.
295
332
333
+
The application should also render any account hints, as they will be needed for any interactive requests to ensure the same user is used for both requests.
Copy file name to clipboardExpand all lines: 6-AdvancedScenarios/4-hybrid-SPA/ReadmeFiles/ReadmeAboutTheCode.md
+39-20
Original file line number
Diff line number
Diff line change
@@ -44,19 +44,35 @@ Next, parse the authorization code, and invoke the acquireTokenByCode API on the
44
44
45
45
When invoking this API, set enableSpaAuthorizationCode to true, which will enable MSAL to acquire a second authorization code to be redeemed by your single-page application.
46
46
47
+
Your application should parse this second authorization code, as well as any account hints (e.g. sid, login_hint, preferred_username) and return them such that they can be rendered client-side:
Next, render the code that was acquired server-side, and provide it to the acquireTokenByCode API on the MSAL.js PublicClientApplication instance.
88
104
105
+
The application should also render any account hints, as they will be needed for any interactive requests to ensure the same user is used for both requests.
0 commit comments