Feathers: anonymous user/browsing

Created on 15 Jan 2017  ·  4Comments  ·  Source: feathersjs/feathers

Hi Guys,

Is there an existing method to allow for anonymous users? I'm working on a mobile app which allows users to use the app without forcing them to register.

Update to question:

In addition to my original question. Would it be simpler to create a "get" only service for the app itself and then when it's time to purchase using methods like (post, put, delete etc..) force user registration login?

I'm just wondering if there would be any security concerns on making a "get" service available without a valid token using feathersjs?

All 4 comments

The 1.0.x version of auth uses PassportJS under the hood, so you would probably be able to get an anonymous strategy to work. I haven't seen any examples floating around, yet.

There's not a concern that's particular to Feathers hen it comes to leaving a get service public and locking down others. It's really simple to setup, but it should work exactly as you imagine it, I think.

If it were me id still assign a 'user' to people who arrived at the site even while they were anonymous.

Just generate an id and use it as their user as soon as they arrive without them logging in and keep a reference of it in their browser so you can id them later. If a user gets too old / inactive delete it. Basically create users and treat them like browser sessions.

When they sign up later then you can just update their already given anonymous user id with more information. Helps with identifiers you might want to store prior to them actually signing up too.

We have 4 different 'types' of user at Headstart and all of them have access to different endpoints. I don't see why you can't just have an anonymous user too. We control our api access mostly by having different 'global' hooks for each type of user. We just add them to each of the services accordingly depending on what access they are allowed.

Hi Guys,

Thank you for your feedback, really appreciate it. I'll check out both suggestions. @Mentioum I do like the idea of creating a user and then converting them on registration.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings