MongoDB Stitch throwing anon-user error
Asked Answered
S

3

7

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:

failed to log in anonymously: { StitchError: authentication via 'anon-user' is unsupported
at /*****/*****/*****/****/node_modules/mongodb-stitch/dist/node/common.js:29:19
at
at process._tickCallback (internal/process/next_tick.js:160:7)
name: 'StitchError',
response:
Body {
url: '*****',
status: 401,
statusText: 'Unauthorized',
headers: Headers { _headers: [Object] },
ok: false,
body:
Gunzip {
_readableState: [ReadableState],
readable: false,
domain: null,
_events: [Object],
_eventsCount: 4,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: true,
_transformState: [Object],
bytesRead: 81,
_handle: null,
_hadError: false,
_writeState: [Uint32Array],
_outBuffer: ,
_outOffset: 57,
_level: -1,
_strategy: 0,
_chunkSize: 16384,
_flushFlag: 0,
_scheduledFlushFlag: 0,
_origFlushFlag: 0,
_finishFlushFlag: 4,
_info: undefined },
bodyUsed: true,
size: 0,
timeout: 0,
_raw:
[ ],
_abort: false,
_bytes: 57 },
json: { error: 'authentication via \'anon-user\' is unsupported' } }

Items marked with ***** were removed for privacy.

I have anonymous authentication enabled in Stitch Admin Console, but it still throws this error. 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.

Is there something I don't know about anonymous auth?

If you know where the mongodb error reference is, that would help as well.

Thanks

Stratovision answered 7/3, 2018 at 3:16 Comment(4)
Can you email me your client app ID or Atlas group ID to [email protected] so I can check your app out? It's probably a simple fix.Seaward
@Seaward sorry I didn't respond for so long. I'll send it now!Stratovision
Have you tried turning on anonymous login via Stitch Apps > Users > Providers > Allow users to login anonymously?Caputto
Hi, I am having same problem, have already check down the app auth method for the stitch app and is ok.Pratique
I
8

FROM

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

"I think you have to deploy it in the deploy session"

Invite answered 6/11, 2019 at 10:35 Comment(0)
S
7

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

Review and deploy changes

Salters answered 29/4, 2020 at 7:52 Comment(0)
J
5

You need to go Stitch Apps > Users > Providers > Allow users to login anonymously and enable that option.

Jeremiahjeremias answered 6/8, 2019 at 6:11 Comment(1)
that didn't helpHighoctane

© 2022 - 2024 — McMap. All rights reserved.