We're trying to use Craft as a CMS for a mobile app and to accomplish this we need to convert entries to JSON. We use the Element API plugin for this and it works like a charm.
The problem is that we don't want certain content to be visible to everyone, so we want to require the users to log in. Is it possible for a user to log in via the mobile app, then get some kind of sessionToken which is stored in the database and then every time the user send a request to the API it sends the token along with it to make sure the user of the mobile app is authenticated (like the token in the craft_sessions table)? If so how can this be accomplished?
Should this require us to write our own plugin with a custom authentication system or is it possible to get this working with the user logic provided by Craft?