Skip to content

Commit 2f6cdac

Browse files
authored
Merge pull request #198824 from derisen/patch-1
add missing imports, fix incomplete code snippet
2 parents 5acefb4 + 006baa4 commit 2f6cdac

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

articles/active-directory/develop/scenario-spa-acquire-token.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ For success and failure of the silent token acquisition, MSAL Angular provides e
154154
import { MsalBroadcastService } from '@azure/msal-angular';
155155
import { EventMessage, EventType } from '@azure/msal-browser';
156156

157+
import { filter, Subject, takeUntil } from 'rxjs';
158+
157159
// In app.component.ts
158160
export class AppComponent implements OnInit {
159161
private readonly _destroying$ = new Subject<void>();
@@ -226,7 +228,7 @@ For success and failure of the silent token acquisition, MSAL Angular provides c
226228
```javascript
227229
// In app.component.ts
228230
ngOnInit() {
229-
this.subscription= this.broadcastService.subscribe("msal:acquireTokenFailure", (payload) => {
231+
this.subscription = this.broadcastService.subscribe("msal:acquireTokenFailure", (payload) => {
230232
});
231233
}
232234
ngOnDestroy() {
@@ -394,15 +396,18 @@ You can use optional claims for the following purposes:
394396
To request optional claims in `IdToken`, you can send a stringified claims object to the `claimsRequest` field of the `AuthenticationParameters.ts` class.
395397

396398
```javascript
397-
"optionalClaims":
398-
{
399-
"idToken": [
400-
{
401-
"name": "auth_time",
402-
"essential": true
403-
}
404-
],
405-
399+
var claims = {
400+
optionalClaims:
401+
{
402+
idToken: [
403+
{
404+
name: "auth_time",
405+
essential: true
406+
}
407+
],
408+
}
409+
};
410+
406411
var request = {
407412
scopes: ["user.read"],
408413
claimsRequest: JSON.stringify(claims)

0 commit comments

Comments
 (0)