Unable to Decode the JWT

Hi All,

I am using JWKS and issuer values in kvm and fetching while those values in the request. I used Decode and Verify JWT policies.

While decoding the JWT token i am getting error like 

jwt.DecodeJWT-GKS.error= invalid serialized unsecured/JWS/JWE object: Missing part delimiters

error.cause= invalid serialized unsecured/JWS/JWE object: Missing part delimiters

Below are the attached snapshots for Decode and Verify JWT: 

Prashanth4576_2-1669898635907.png

 

Prashanth4576_3-1669898649048.pngPrashanth4576_4-1669898675055.png

 

 

 

 

 

 

0 13 3,977
13 REPLIES 13

You can confirm the validity JWT token by going to jwt.io and decode it, this confirms the JWT is valid and has no issues with delimiters. So we can narrow down the issue if its on the token.

Thanks.

What does the "token" variable look like? 

"missing part delimiters" suggests that the dots that separate the parts of the JWT are not present. 

Try "manually" decoding the JWT using an online interactive tool.  For example, this one works

If you want to better understand what I mean by "the parts" of a JWT, you can check this video.

screenshot-20221201-101316.png


@Prashanth4576 wrote:

I am using JWKS and issuer values in kvm and fetching while those values in the request


The JWKS and issuer values are not relevant to the task of decoding the JWT.  Those things would be used only when validating the JWT.  You have a different problem: the thing you believe to be a JWT is non-parseable. (Maybe it's not a JWT!).  You've got to solve THAT problem before trying to validate the JWT using a JWKS and a specific issuer.  

Dots are there in the JWT token and it's segregated Header, Payload and signature. 

Generated new token and tried to decode the same but still same issue. 

ok then some other assumption is invalid. 

Are you sure you're passing the token appropriately?  Is it in the authorization header?  Is there a Bearer prefix? etc.

Good luck!

Yes you're correct.

In headers Authorization bearer JWTTOKEN.

 

 

 

 

The Bearer prefix is case sensitive

Sorry my bad typo mistake 

Are you saying the problem is resolved?  Or are you saying that the typo was only in the message you posted here? or something else?

I told that the typo mistake in the message.

I used Bearer only but no use and issue is still persisting. 

 

@dchiesa1 Can you help here to found the issue. 

I don't have any further ideas. 

You need to insure that the JWT is a JWT. That the Source element in the VerifyJWT (or DecodeJWT) policy is set properly. Check the documentation.

Thanks for you prompt response.

@Prashanth4576Did you find the cause of the error? I'm facing similar issue