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

Spaceface16518
  • 101
  • 3
  • 8
  • Can you email me your client app ID or Atlas group ID to eric.daniels@mongodb.com so I can check your app out? It's probably a simple fix. – edaniels Mar 08 '18 at 00:00
  • @edaniels sorry I didn't respond for so long. I'll send it now! – Spaceface16518 Mar 28 '18 at 19:48
  • Have you tried turning on anonymous login via Stitch Apps > Users > Providers > Allow users to login anonymously? – Kevin Jul 11 '18 at 08:07
  • Hi, I am having same problem, have already check down the app auth method for the stitch app and is ok. – LucasRT Sep 23 '19 at 04:30

3 Answers3

8

FROM

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

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

Chris
  • 109
  • 1
  • 3
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

Devorein
  • 1,112
  • 2
  • 15
  • 23
5

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

barryjones
  • 2,149
  • 1
  • 17
  • 21