Approach to create headless drupal with login

by Tyler Durden   Last Updated June 15, 2018 20:07 PM

I am curious on the approach I will have to take if I would like to build an app that connects to Drupal. I have already built simple headless drupal app using only get requests.

I am able also to make posts requests with Basic Auth or Auth0 mainly via postman and the concept of this is clear.

What is not clear to me is how I will be able to manage a logged in user from let's say a React/Vue.js app.

Let's say we have an app that servers 2 types of content: News and Events. News is public and Events is for logged in users. News and Events will be two Rest Export views in Drupal and Events will have an authentication method.

Now if a user wants to see Events he/she must be logged in. So the user will login via a login form and the session should be persisted. The app sends the request to Drupal, logs the user in and give a cookie/token/jwt back? So I will be able to use that cookie/token/jwt to access events and events/nid?

What should I use in this case in order to persist a login?

Thanks in advance.

Tags : 8 users headless

Related Questions

Drupal form to Vue?

Updated September 02, 2017 17:07 PM