Allow anonymous access to my Azure OpenAI chat bot

news/2024/9/23 20:58:35/
aidu_pl">

题意:允许匿名访问我的 Azure OpenAI 聊天机器人

问题背景:

I have an Azure OpenAI chat bot using my own data (I configured an OpenAI resource and chose Deploy as Web App) . Members of my domain can access it by logging in. Now I want it to be accessible anonymously or for other domains I define - whatever is easier to configure.

我有一个使用我自己数据的 Azure OpenAI 聊天机器人(我配置了一个 OpenAI 资源并选择了以 Web 应用的形式部署)。我的域内成员可以通过登录访问它。现在我希望它可以匿名访问,或者对我定义的其他域开放——以更容易配置的方式为准。

In the Azure Web App Authentication settings I could do two things:

在 Azure Web 应用的身份验证设置中,我可以做两件事:

  • Disable Authentication   禁用身份验证
  • Allow unauthenticated access   允许未认证的访问

See this screenshot:        看下面的截图

When I disable authentication or when I allow unauthenticated access I get in both cases the same error message when opening the chat bot:

当我禁用身份验证或允许未认证的访问时,在打开聊天机器人时,两种情况下都会出现相同的错误消息:

Authentication Not Configured

I also tried to allow not only my single domain but multiple account types of the Identity Provider. But when I login with a different domain I still the an error messge:

我还尝试允许不仅是我的单一域名,还包括多个身份提供者的帐户类型。但是,当我使用不同的域名登录时,我仍然看到错误消息:

AADSTS50020: User account 'myuser@otherdomain' from identity provider 'https://sts.windows.net/....../' does not exist in tenant 'MyDomain' and cannot access the application 'MyChatBot') in that tenant.

How to do it properly?        该如何正确配置?

问题解决:

Context

You have to understand that the "Deploy to Web App" button in Azure OpenAI Studio is only an accelerator for the "all-in-one" deployment of a project which is in fact open-sourced by Microsoft.

你需要了解,Azure OpenAI Studio 中的“部署到 Web 应用”按钮只是一个用于项目“一体化”部署的加速器,而该项目实际上是由微软开源的。

It's this one:         就是这个:   GitHub - microsoft/sample-app-aoai-chatGPT: Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.

So the Authentication Not Configured message you are facing is implemented inside this project, here: 

所以你遇到的 “Authentication Not Configured” 错误消息是实现于该项目内部的,位置在这里:sample-app-aoai-chatGPT/frontend/src/pages/chat/Chat.tsx at af9d06b4ba153523fed366d3f8b1b19d1fc5f5e8 · microsoft/sample-app-aoai-chatGPT · GitHub

Possible solution        可能的解决方案

The README of the project explains that you can remove it if you want, here

该项目的 README 中解释了如果你想移除它,可以查看这里。

To remove this restriction, you can add AUTH_ENABLED=False to the environment variables. This will disable authentication and allow anyone to access the chat functionality of your app. This is not recommended for production apps.

As said, "This is not recommended for production apps.".

正如所说,“这不建议用于生产环境的应用程序。”

Especially as the frontend is calling itself for the conversation (POST to /conversation) so if you remove the authentication, I guess that someone could use this endpoint directly to consume your OpenAI resource which is behind (ok, they can't modify your system message etc. but it's still an issue)

特别是因为前端是通过自身调用进行对话的(POST 到 /conversation),所以如果你移除了身份验证,我猜测有人可能会直接使用这个端点来消耗你后台的 OpenAI 资源(虽然他们不能修改你的系统消息等,但这仍然是一个问题)。


http://www.ppmy.cn/news/1529492.html

相关文章

C++学习笔记(32)

三十四、双链表 示例&#xff1a; #include <iostream> using namespace std; typedef int ElemType; // 自定义链表的数据元素为整数。 struct LNode // 双链表的结点。 { ElemType data; // 存放结点的数据元素。 struct LNode* prior,*next; // 前驱和后继结点的指针。…

Nginx实用篇:实现负载均衡、限流与动静分离

Nginx实用篇&#xff1a;实现负载均衡、限流与动静分离 | 原创作者/编辑&#xff1a;凯哥Java | 分类&#xff1a;Nginx学习系列教程 Nginx 作为一款高性能的 HTTP 服务器及反向代理解决方案&#xff0c;在互联网架构中扮演着至关重要的角色。它…

计算机网络33——文件系统

1、chmod 2、chown 需要有root权限 3、link 链接 4、unlink 创建临时文件&#xff0c;用于非正常退出 5、vi vi可以打开文件夹 ../是向外一个文件夹 6、ls ls 可以加很多路径&#xff0c;路径可以是文件夹&#xff0c;也可以是文件 ---------------------------------…

vue选项式写法项目案例(购物车)

一、初始化项目结构 1.初始化vite项目 npm create vite cd vite-project npm install 2.清理项目结构 清空App.vue 删除components目录下的HelloWorld.vue组件 3.为组件的样式启用sacc或less组件 npm i sass4.初始化index.css全局样式 :root{font-size:12px } 二、封装…

2024自学手册——网络安全(黑客技术)

前言 什么是网络安全 网络安全可以基于攻击和防御视角来分类&#xff0c;我们经常听到的 “红队”、“渗透测试” 等就是研究攻击技术&#xff0c;而“蓝队”、“安全运营”、“安全运维”则研究防御技术。 如何成为一名黑客 很多朋友在学习安全方面都会半路转行&#xff0c…

活动报名丨智源Workshop,从o1出发探索LLM推理与思维链

近期o1模型的发布&#xff0c;预示着AI在处理高度复杂问题上再次迈出一大步。大规模强化学习算法在一个数据极高的训练过程中&#xff0c;教会了模型如何利用其思维链进行富有成效的思考。 北京时间9月19日&#xff08;本周四&#xff09;晚7点&#xff0c;智源社区将组织「智源…

C++:使用tinyxml2获取节点下元素

场景 假设有以下 XML 文档&#xff1a; <?xml version"1.0"?> <Root><Kind>ExampleText</Kind> </Root>以下是如何使用这行代码来获取 <Kind> 元素的文本内容&#xff1a; #include "tinyxml2.h" #include <i…

深度学习速通系列:中文文本处理步骤

在深度学习中&#xff0c;中文文本处理通常涉及以下几个关键步骤&#xff1a; 分词&#xff1a;由于中文文本不像英文那样有明显的单词分隔符&#xff0c;因此需要通过分词工具&#xff08;如jieba&#xff09;将句子切分成单个词语。 去除停用词和特殊字符&#xff1a;清理文…