adonisjs / auth

Official Authentication package for AdonisJS
https://docs.adonisjs.com/guides/auth/introduction
MIT License
191 stars 65 forks source link

Working with external authentication providers #192

Closed grad44 closed 2 years ago

grad44 commented 2 years ago

I am using Clerk.dev for user authentication. Since I only store emails and passwords in the database of Clerk, I created a user model which holds all the additional data and references the Clerk model using an unique id.

When logging in Clerk returns (like Auth0) a JWT. However, I wondered if I could use this external provider and the built-in auth package together because I'd love to use bouncer for authorization. My current implementation contains a self made middleware function which validates the JWT. This works fine, altough getting the user payload in the requests is a bit ugly (I extended the request class and implemented a method which returns the local db user which belongs to the JWT).

Is there a way to use external authentication providers with the auth package? The docs only mention a custom user provider, which is kinda what I was looking for, but this would require implementing a login and other functions as well which isn't neccessary since my provider handles all that stuff.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.