阿波罗服务器Azure功能 - 更改沙盒端点
我正在使用 apollo服务器,具有azure函数 嵌入式登录页插件的选项,该插件允许将沙箱嵌入服务器端点。
这就是我当前的配置看起来像是
const server = new ApolloServer({
schema,
context: ({ context }) => context,
plugins: [ApolloServerPluginLandingPageLocalDefault({
embed: true
})],
});
export default server.createHandler({
cors: {
origin: '*'
},
});
要通过使用Azure Active Directory锁定Azure的功能应用程序,并且没有授权的401:未经授权的请求将被拒绝。但是,问题在于,当在Azure部署时尝试访问沙箱时,也将拒绝访问沙箱。
有没有办法指定一个单独的沙盒端点,该端点可以允许未经验证的请求?然后,从沙盒中,我们可以在授权中发送:Bearer ...
标题到实际的GraphQl端点。
I'm using Apollo Server with Azure Functions and as of a v3.8.0 there is a new embed
option for the landing page plugin which allows the sandbox to be embedded into the server endpoint.
This is what my current config looks like
const server = new ApolloServer({
schema,
context: ({ context }) => context,
plugins: [ApolloServerPluginLandingPageLocalDefault({
embed: true
})],
});
export default server.createHandler({
cors: {
origin: '*'
},
});
I'd like to lock down the Function App in Azure by using Azure Active Directory and having any unauthenticated requests get rejected with 401: Unauthorized. The problem, however, is that would also deny access to the sandbox when trying to access it when deployed in Azure.
Is there a way to specify a separate sandbox endpoint that could allow unauthenticated requests? Then from the sandbox we could send in a Authorization: Bearer ...
header to the actual graphql endpoint.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论