Django backend, VueJS front end, and user database -- whats the flow?

I’m new to Auth0 and trying to understand how it fits in to the flow of a new project I’m working on. Here’s the layout:

  • VueJS client on the frontend. No Server Side Rendering
  • Django on the backend, using DRF and JWT.
  • Users are associated with certain clients to limit access, so a user database with these relationships must be maintained.

I’m trying to understand how the architecture fits together. I have my VueJS app authenticating to Auth0, no problems. But my Django application knows nothing of the Auth0 user.

Django has the remote user option as described here Auth0 Django API SDK Quickstarts: Authorization. However, that is django authenticating not the Vue frontend.

Do I use the custom database option Custom Database Connections

So how does this go together? If I authenticate VueJS to Auth0, how does Django know the token is valid? Do I go vue->django->Auth0? Seems clunky?

I expect this has been done before, I’d just like some guidance on the correct path to take?

Many thanks for any assistance.

Andrew

Hi Andrew,

You need to use the implicit flow - designed for SPAs (really, any application where the logic is implemented on the client side accessing an API on the server side).

This tutorial will help:

In this tutorial, the API is your Django backend.

John

1 Like