ueberauth / guardian

Elixir Authentication
MIT License
3.44k stars 381 forks source link

Guardian JWE module #481

Closed davepersing closed 5 years ago

davepersing commented 6 years ago

Hi Guardian team!

Thanks for all you do. Guardian is wonderful.

I wrote a JWE Token implementation for use with Guardian. I wasn't sure if that was something you wanted to try to bring under the Ueberauth umbrella or not. Either way, I'm happy to maintain it.

Repo is here: https://github.com/davepersing/guardian_jwe

Lots of the code is ripped directly from the JWT token implementation since they're very similar (hope that's alright!). The encode_and_sign function changed to call JWE.block_encrypt\3 instead of JWT.sign. Always looking to learn something new, so please let me know if there's a better way to implement this. Been working with Elixir for a couple of years, but still feel like a noob. :D

Cheers, Dave

hassox commented 6 years ago

This is cool @davepersing! Can we chat on #ueberauth slack?

davepersing commented 6 years ago

@hassox - Yep, can do. Will jump on and ping you there. Thanks!

expelledboy commented 6 years ago

Hey guys, I want to use JWE to pass around sensitive user profile information. Based off this thread, can I assume guardian doesnt support JWE? Does the underlying JOSE library not support JWE?

Otherwise @hassox can your changes not be merged into guardian?

davepersing commented 6 years ago

@expelledboy - Guardian doesn't support JWE directly, so I wrote the extension to implement JWE with Guardian. Repo is here: https://github.com/davepersing/guardian_jwe

No doubt there are improvements to be made to the lib. :) It's using the JOSE JWE functions to implement a JWE module for usage within Guardian.

Let me know if I can answer questions about it.

Cheers, Dave

hassox commented 6 years ago

Awesome! Fwiw guardian only default provides JWT. This is exactly an example of why guardian uses tokens and not JWT!

Your repo and token implementation makes me so happy!

@expelledboy which changes are you referring to?

expelledboy commented 6 years ago

Sorry I understood that it was a fork of guardian, read through README now 🤣 @davepersing thank you for efforts!

doomspork commented 5 years ago

@davepersing if you're open to helping with the on-going maintenance we'd love to have you join the Ueberauth team to help with those efforts. Is this something you'd be open to?

davepersing commented 5 years ago

@doomspork - I am absolutely open to it.

I can't dedicate to full-time assistance (full-time job and a side-gig), but I'm absolutely happy to help out wherever I can!

doomspork commented 5 years ago

@davepersing if you want to transfer the repo to ueberauth I will accept it and add you to the org 😁

davepersing commented 5 years ago

Will do directly after lunch!

doomspork commented 5 years ago

@davepersing I've invited you to our freshly created @ueberauth/jwe team 😁

@davepersing do you have a twitter handle btw?

davepersing commented 5 years ago

@doomspork - Re: Twitter - it's @llamaindustries.

Repository is transferred. Added all the teams to the repo.

Thank you, sir!

doomspork commented 5 years ago

Welcome aboard @davepersing 🎉

yordis commented 5 years ago

🎉