简体   繁体   English

MongoDB Stitch 抛出非用户错误

[英]MongoDB Stitch throwing anon-user error

I am using mongodb's stitch backend to run an application, and when I try to login as an anonymous user, it throws this error:我正在使用 mongodb 的缝合后端来运行一个应用程序,当我尝试以匿名用户身份登录时,它会抛出此错误:

failed to log in anonymously: { StitchError: authentication via 'anon-user' is unsupported匿名登录失败:{ StitchError:不支持通过“匿名用户”进行身份验证
at /*****/*****/*****/****/node_modules/mongodb-stitch/dist/node/common.js:29:19在 /*****/*****/*****/****/node_modules/mongodb-stitch/dist/node/common.js:29:19
at
at process._tickCallback (internal/process/next_tick.js:160:7)在 process._tickCallback (internal/process/next_tick.js:160:7)
name: 'StitchError', name: 'StitchError',
response:回应:
Body {身体{
url: '*****',网址:'*****',
status: 401,状态:401,
statusText: 'Unauthorized', statusText: '未经授权',
headers: Headers { _headers: [Object] },标题:标题{_headers:[对象]},
ok: false,好的:假的,
body:身体:
Gunzip {枪拉链{
_readableState: [ReadableState], _readableState: [ReadableState],
readable: false,可读:假,
domain: null,域:空,
_events: [Object], _events: [对象],
_eventsCount: 4, _eventsCount: 4,
_maxListeners: undefined, _maxListeners:未定义,
_writableState: [WritableState], _writableState: [WritableState],
writable: false,可写:假,
allowHalfOpen: true,允许半开:真,
_transformState: [Object], _transformState: [对象],
bytesRead: 81,字节读取:81,
_handle: null, _句柄:空,
_hadError: false, _hadError:错误,
_writeState: [Uint32Array], _writeState: [Uint32Array],
_outBuffer: , _outBuffer: ,
_outOffset: 57, _outOffset: 57,
_level: -1, _级别:-1,
_strategy: 0, _策略:0,
_chunkSize: 16384, _chunkSize:16384,
_flushFlag: 0, _flushFlag: 0,
_scheduledFlushFlag: 0, _scheduledFlushFlag: 0,
_origFlushFlag: 0, _origFlushFlag: 0,
_finishFlushFlag: 4, _finishFlushFlag: 4,
_info: undefined }, _info: 未定义 },
bodyUsed: true, bodyUsed:真实,
size: 0,尺寸:0,
timeout: 0,超时:0,
_raw: _原始:
[ ], [ ],
_abort: false, _abort:假,
_bytes: 57 }, _bytes: 57 },
json: { error: 'authentication via \\'anon-user\\' is unsupported' } } json: { 错误: '不支持通过 \\'anon-user\\' 进行身份验证' } }

Items marked with ***** were removed for privacy.出于隐私考虑,已删除标有*****项目。

I have anonymous authentication enabled in Stitch Admin Console, but it still throws this error.我在 Stitch Admin Console 中启用了匿名身份验证,但它仍然引发此错误。 My app is not even able to perform any operations on the database before this happens, so I know it does not have to do with my app's Rules .在发生这种情况之前,我的应用程序甚至无法对数据库执行任何操作,所以我知道这与我的应用程序的Rules无关。

Is there something I don't know about anonymous auth?关于匿名身份验证,我有什么不知道的吗?

If you know where the mongodb error reference is, that would help as well.如果您知道 mongodb 错误参考在哪里,那也会有所帮助。

Thanks谢谢

FROM发件人

https://github.com/Spaceface16518/Converse/issues/22 https://github.com/Spaceface16518/Converse/issues/22

"I think you have to deploy it in the deploy session" “我认为你必须在部署会话中部署它”

您需要转到 Stitch Apps > Users > Providers > 允许用户匿名登录并启用该选项。

First you must allow anonymous login首先你必须允许匿名登录

Allow Users to login anonymously允许用户匿名登录

Click on the review and deploy changes at the top of the stitch UI单击针迹 UI 顶部的审查和部署更改

Review and deploy changes查看和部署更改

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

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