|
1 | 1 | <h2>BFF Security architecture with Angular CLI</h2> |
2 | 2 |
|
3 | | -@if (userProfileClaims$ | async; as userProfileClaims) { |
4 | | - @if (userProfileClaims?.isAuthenticated) { |
5 | | - <div> |
6 | | - <button (click)="getDirectApiData()">get data from API direct</button> |
7 | | - <button (click)="getGraphApiDataUsingApi()"> |
8 | | - get Graph data using API |
9 | | - </button> |
10 | | - <form method="post" action="api/Account/Logout"> |
11 | | - <button class="btn btn-link" type="submit">Sign out</button> |
12 | | - </form> |
13 | | - </div> |
14 | | - } @else { |
15 | | - <a class="btn btn-link" href="api/Account/Login">Log in</a> |
16 | | - } |
17 | | - <hr /> |
18 | | - <h2>User profile:</h2> |
19 | | - <pre>{{ userProfileClaims | json }}</pre> |
20 | | - <hr /> |
21 | | - <h2>get direct data using API:</h2> |
22 | | - <pre>{{ dataFromAzureProtectedApi$ | async | json }}</pre> |
23 | | - <hr /> |
24 | | - <h2>get Microsoft Graph data using API:</h2> |
25 | | - <pre>{{ dataGraphApiCalls$ | async | json }}</pre> |
| 3 | +@if (userProfileClaims$ | async; as userProfileClaims) { @if (userProfileClaims?.isAuthenticated) { |
| 4 | +<div> |
| 5 | + <button (click)="getDirectApiData()">Get data from API direct</button> |
| 6 | + <button (click)="getGraphApiDataUsingApi()">Get Graph data using API</button> |
| 7 | + <form method="post" action="api/Account/Logout"> |
| 8 | + <button class="btn btn-link" type="submit">Sign out</button> |
| 9 | + </form> |
| 10 | +</div> |
26 | 11 | } @else { |
27 | | - <a class="btn btn-link" href="api/Account/Login">Log in</a> |
| 12 | +<a class="btn btn-link" href="api/Account/Login">Log in</a> |
| 13 | +} |
| 14 | +<hr /> |
| 15 | +<h2>User profile:</h2> |
| 16 | +<pre>{{ userProfileClaims | json }}</pre> |
| 17 | +<hr /> |
| 18 | +<h2>get direct data using API:</h2> |
| 19 | +<pre>{{ dataFromAzureProtectedApi$ | async | json }}</pre> |
| 20 | +<hr /> |
| 21 | +<h2>get Microsoft Graph data using API:</h2> |
| 22 | +<pre>{{ dataGraphApiCalls$ | async | json }}</pre> |
| 23 | +} @else { |
| 24 | +<a class="btn btn-link" href="api/Account/Login">Log in</a> |
28 | 25 | } |
29 | | - |
0 commit comments