![]() ![]() For client-side Blazor applications we have to create our own implementation of AuthenticationStateProvider. For server-side Blazor applications this additional work is done for us by product group. Getting authentication work with AuthorizeView component is a little bit tricky and needs some additional work. It is not needed for server-side Blazor application as authentication status is always known in this case. In this case there is also third authorization status involved – Authorizing.Īuthorizing status is fully supported by AuthorizeView component. We may have logon form implemented as Blazor view or component and authentication is done through backing Web API. ![]() This is how things work with server-side Blazor applications.Ĭlient-side Blazor applications run in browser and authentication doesn’t happen necessarily on separate page of web application. The following fragment of code is taken from LoginDisplay.razor view of default server-side Blazor application. It’s simple component that shows child content based on authorization status of user. Credits go to Github user rabberbock for his repository BlazorAuthTest.ĪuthorizeView is Blazor component introduced in ASP.NET Core 3.0 Preview 6. Things shown here may not work with future releases. NB! The code here is written for ASP.NET Core 3.0 Preview 6. This blog shows how AuthorizeView and Authorizing state work in client-side Blazor applications. After blogging about authentication in server-side Blazor applications and discovering AuthorizationView component I was eager to find out how to use third authentication state Authorizing that is not available for server-side Blazor applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |