1

I am using FusionAuth. We have created one application in it. It is an OAuth application.

It generates the JWT access token. I copy the access token and past it in the https://jwt.io/ debugger and see that, it is able to decode the JWT token and I am able to see the payload of the JWT. As this JWT is only signed and not encrypted.

Here, I want to generate the JWT as encrypted, So how I can generate JWT access token as encrypted, So basically I want a Signed and encrypted JWT and how fusion will validate it if we find a way to generate the JWT in an encrypted way?

Thank you.

Dhaval Bhoot
  • 241
  • 1
  • 5
  • 18

2 Answers2

3

FusionAuth does not currently support JWT encryption, we only support signing using HMAC, RSA or EC algorithms.

You could sign and encrypt a JWT outside of FusionAuth but FusionAuth will not be able to validate the signature.

If this is something you'd like to see in FusionAuth please open a feature request on our GitHub issues repository.

Thanks!

robotdan
  • 1,022
  • 1
  • 9
  • 17
-2

You have to add some secret string (salt) in second parameter just like this :

var token = jwt.sign({ foo: 'bar' }, 'I'm-secret-Salt ')

  • Thanks for the reply. How can I achieve this in FusionAuth? Do I need to write this in Lambda delegate or somewhere else? – Dhaval Bhoot Dec 31 '19 at 15:16
  • This answer assumes some specific JWT signing library, the user is asking how to accomplish this in FusionAuth specifically. – robotdan Dec 31 '19 at 16:19