ahopkins / sanic-jwt

Authentication, JWT, and permission scoping for Sanic
http://sanic-jwt.readthedocs.io
MIT License
242 stars 52 forks source link

Question: is sanic-jwt deprecated? #222

Closed SerGeRybakov closed 2 years ago

SerGeRybakov commented 2 years ago

Hi Adam!

I'm trying to build an authentication service with Sanic and JWT, and I'm a bit confused as you have this repo, but in official documentation there's no any reference on it. Moreover, here. you provide some opposite examples.

So shall I follow official docs or shall I use sanic-jwt?

Thanks in advance!

ahopkins commented 2 years ago

Not deprecated! But, I maintain this one personally outside of the Sanic organization so that is why it is not mentioned there.

There likely will be a v2 overhaul (backend mainly, the API itself will stay largely the same) to it sometime this year. However, I still use it in production and maintain it here.

SerGeRybakov commented 2 years ago

And what is your recommendation for best practice in this case?

ahopkins commented 2 years ago

That example in the docs is very barebones. Sanic JWT has a lot of additional features for adding claims to the payload, etc. I'd suggest using this lib if it works for you. Happy to assist if you have questions.

Here's a talk I gave on deciding on an auth strategy: https://youtu.be/Uqgoj43ky6A

Especially when powering a PWA and want access to the payload, take a look at setting it up with split cookies. https://sanic-jwt.readthedocs.io/en/latest/pages/protected.html#cookie-tokens

SerGeRybakov commented 2 years ago

Yep, I've watched this video today. Thanks a lot! If I have any questions, shall I post them here or somewhere else?

ahopkins commented 2 years ago

Here is fine. Or, in the #plugins channel in the Sanic discord server for the fastest response from me 😉