Skip to content

Commit f967489

Browse files
committed
2 parents 83f0b72 + db4ab85 commit f967489

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# BlazorGraphApi
22

3-
Blazor Server App with AD Authentication, that calls the MS Graph API on-behalf of the signed-in user.
4-
5-
It works, but still working through some issues
3+
Blazor Server App with Azure AD Authentication, that calls the Microsoft Graph API on-behalf of the signed-in user.
64

75
This code uses [Microsoft.Indentity.Web](https://github.com/AzureAD/microsoft-identity-web)
86

@@ -30,18 +28,19 @@ You will need to register your app in Azure and modify appsettings.json to inclu
3028
}
3129
```
3230

33-
# Issues
31+
# Notes
3432

35-
I had some problems the first time the user loads the blazor MS Graph profile page.
33+
I had some problems the first time the user loads the Blazor MS Graph profile page.
3634

37-
In this situation the browser cookies exist, but the in-memory cache does not. This causes a MsalUiRequiredException to be thrown.
38-
Deleting the browser cookies and reloaded the page sort of worked, but I was looking for a better solution.
35+
In this situation the auth browser cookies exist, but the in-memory cache does not. This causes a MsalUiRequiredException to be thrown. Deleting the browser cookies and reloaded the page sort of worked, but I was looking for a better solution.
3936

4037
In the samples provided with Microsoft.Indentity.Web
41-
they add ``` [AuthorizeForScopes(Scopes = new[] { Constants.ScopeUserRead })] ``` attribute to the controller, which catches the exception, signs the user out and then signs them back in, which populated the token cache. This also works for razor pages, so I added this to __Host.cshtml PageModel.
38+
they add<br/>
39+
``` [AuthorizeForScopes(Scopes = new[] { Constants.ScopeUserRead })] ```<br/>
40+
attribute to the controller, which catches the exception, signs the user out and then signs them back in, which populates the token cache. This also works for razor pages, so I added this to _Host.cshtml PageModel.
4241

4342

44-
__Hosts.cshtml.cs
43+
_Host.cshtml.cs
4544

4645
```
4746
using BlazorGraphApi.Services;

0 commit comments

Comments
 (0)