adonisjs / auth

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

JWT support #207

Closed hichemfantar closed 1 year ago

hichemfantar commented 1 year ago

Why this feature is required (specific use-cases will be appreciated)?

JWT authentication is a very common method of authentication especially on mobile applications.

Have you tried any other work arounds?

There's a third party package but I'd prefer a first party solution like Laravel Sanctum. I noticed that jwt auth was available in v4 but for some reason it's gone in v5.

Are you willing to work on it with little guidance?

Will try my best. But I'm still not familiar with the codebase.

RomainLanz commented 1 year ago

Hey @hichemfantar! 👋🏻

What's wrong with using OAT instead of JWT in your case? Laravel Sanctum handles OAT as Adonis does. They do not manage JWT.

JWTs are for specific use cases that 90% of people never reached (like multi-server environments). I recommend watching 100% Stateless with JWT to understand a bit more when to use a JWT.

hichemfantar commented 1 year ago

I appear mistaken in that laravel sanctum's solution isn't exactly like JWT but It provides similar functionality. I assume I'm supposed to simply use API tokens for my mobile application? What do you mean exactly by OAT Token? OAT Token= opaque access token. Got it.

RomainLanz commented 1 year ago

Yes, OAT (API Tokens) should work for your use case. 👍🏻

hichemfantar commented 1 year ago

Great, I'm closing this then.