Hi. I’m using guardian for generating JWT tokens. Is there any way/configs or a good example how to change the JWT issuer at runtime? I’ve read the docs and it’s not very clear. Any help would be great.
config :my_app, MyApp.Guardian,
issuer: "some value",
secret_key: "some key"
For note, guardian is more for making database-less multi-non-communicating-server API’s, its JWT’s contain excess information and thus are slightly more heavyweight than what is needed for general JWT usage. If you want a JWT library then Joken should be used, and unlike Guardian you can specify the issuer, sercret_key, and everything else at the call site instead of at configuration.
3 Likes