How to implement external authentication?

My app is intended to make calls to GSuite API on behalf of logged in users. I want to use JWT authentication.

I want to have my users login w/Google (got that working) and then send their client token_id to adonis which should use a Google API to determine if that login is valid within a given GSuite account.

Then i want to return the roles/permissions available to that user in a JWT

Is it the right thing to create my own Adonis Serializer to do this? How would I go about doing that?

1 Like