Blazor WebAssembly - how to securely consume private/restricted API?

帅比萌擦擦* 提交于 2021-01-28 19:19:25

问题


I want to build 2 apps.

  1. Private API in .NET that takes care of database access / processing of data.
  2. Blazor WebAssembly app which will connect to this API securely, to search data.

Since Blazor WebAssembly DLLs can be decompiled, I can't use any private/secret keys in the APP. I don't want anyone being able to use the API if they discover the endpoints. Only the Blazor APP can use the API (and any other app I might build in the future).

How should I approach this? Is it even possible to do it securely or should I go Server Side?


回答1:


Secure ASP.NET Core Blazor WebAssembly explains how to secure a Blazor WASM app

Blazor WebAssembly 3.2.0 Preview 2 release now available explains how to use IAccessTokenProvider to get the access token to authentify your applicaton on API.



来源:https://stackoverflow.com/questions/61210462/blazor-webassembly-how-to-securely-consume-private-restricted-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!