简体   繁体   English

MAUI Blazor 认证授权

[英]MAUI Blazor authentication and authorization

Maybe I'm missing something but in the file MauiProgram.cs the builder.Build() return an object of type MauiApp and this does not contain the extension methods UseAuthentication() and UseAuthorization() that normaly in Blazor/asp net core projects you would find for IApplicationBuilder .也许我遗漏了一些东西,但在MauiProgram.cs文件中, builder.Build()返回一个 MauiApp 类型的MauiApp ,这不包含在 Blazor/asp 网络核心项目中通常的扩展方法UseAuthentication()UseAuthorization()会找到IApplicationBuilder So do I need to use the WebAuthenticator as explained here https://devblogs.microsoft.com/xamarin/xamarin-essentials-1-7-and-introducing-net-maui-essentials/ in order to archieve the same result?那么我是否需要使用此处解释的WebAuthenticator https://devblogs.microsoft.com/xamarin/xamarin-essentials-1-7-and-introducing-net-maui-essentials/来获得相同的结果?

As OP stated, he extended AuthenticationStateProvider and making a custom one..正如OP所说,他扩展了 AuthenticationStateProvider 并制作了一个自定义的..

I added an example of this here:我在这里添加了一个例子:

AuthenticationStateProvider example AuthenticationStateProvider 示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM