#JWT lib

1 messages · Page 1 of 1 (latest)

desert swift
#

Hi, I need to decode a JWT signed with RS256 in BEAM target. I’ve found 2 lib doing that:

But:

  • gwjt does not compile, it relies on what’s looking like a pre-1.0 Gleam function dynamic.unsafe_coerce.
  • gwt does not handle RS256.

Do you know any other lib that might do JWT decoding?

nimble kestrel
#

gjwt with dynamic.unsafe_coerce will compile if you set your gleam_stdlib version to 0.39.0. It was removed in the latest version (0.40.0)

desert swift
#

Thanks @nimble kestrel ! Is it problematic to have an old version of the gleam_stdlib in my project? Will I still be able to use new features?

nimble kestrel
#

The stdlib is just a package, and it's distributed separately from the compiler

#

So no issues unless you want features from a newer version of the stdlib specifically - you'll still be able to use the latest Gleam version

valid magnet
#

It’ll mean you won’t be able to use packages which want newer versions of the stdlib

#

It’ll likely be a sizeable problem outside of a smaller project

desert swift
#

It might be better to help upgrade stdlib in gjwt I guess. I’ve cloned the project to see what I can do and commented out what’s not compiling to test it but I don’t know how to use the lib properly (I think I’m doing something wrong when I create the key with my public key from Keycloak, it won’t decode the JWT)