首页 > 解决方案 > 为 VueJs 前端和 Azure 函数应用程序后端实现身份验证/授权的最佳方法是什么

问题描述

我正在构建一个系统,该系统由使用 VueJs 的前端 SPA 构建组成,后端由一组 Azure 函数 (C#) 组成。我已经完成了原型,我正在向应用程序添加用户身份验证/授权功能。该应用程序是 B2B,因此无需外部身份提供者,也无需注册。所有用户都将由系统管理员创建。我有多种选择:

  1. 自己开发认证/授权/用户管理。
  2. 使用 Azure AD B2C
  3. 使用 Auth0 服务

我之前没有使用过#2 和#3。我需要帮助来选择更适合我需要的选项。或者也许有更好的选择。

标签: azurevue.jsauthenticationauthorizationazure-functions

解决方案


Regarding (2), it seems you don't need to use Azure AD B2C, given that you will not authenticate with external identities. A better alternative is to create a multi-tenant SaaS application and offer it to other Azure AD tenants of your choice (even the free tier might cover your needs). For your Vue.js client, you can leverage MSAL.js and you can use Microsoft.Identity.Web to protect your Azure Function app

Have a look at these code samples.


推荐阅读