go-jose icon indicating copy to clipboard operation
go-jose copied to clipboard

The example for making encrypted JWTs doesn't work

Open asilverman opened this issue 4 years ago • 2 comments

Execute the code example found here: https://pkg.go.dev/gopkg.in/square/go-jose.v2/jwt#example-Encrypted

The resulting JWT token is invalid, it has no contents

eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4R0NNIiwidHlwIjoiSldUIn0..JY8-0PpFpvdrKEf8.f_7kAbKUHASjdv4Tuz14b2fUDPRm8uPIiRGmcNY27WA.YxpmkzkaVwzrU1-gjkAKYA

asilverman avatar Sep 22 '20 07:09 asilverman

I tried replicating the problem, however it worked for me both ways. I can create a JWE (using the referenced example) and then later decode claims from it (using this example).

@asilverman, could you please provide steps to replicate the issue?

pippo avatar Oct 18 '20 19:10 pippo

@pippo notice how the example you are referencing is using a JWT with no contents (a substring ..) means no claims payload

asilverman avatar May 25 '21 20:05 asilverman