Need help in creating JWT using JWTheader and JWTpayload

Hi Team,

I have written the workflow for creating JWT using .NET code. The script is first loading the JWT from key.jwt file and creates a RSA provider from it. it then creates signing credentials using RSA provider and RS256 algorithm. The JWT payload is loaded the payload.json file and JWT is created using header and payload.JWT is written in jwt.txt file.
Here, In Assign activity for JWT creation, I am getting compile error in below code:
jwttoken = new JwtSecurityToken(header, new JwtPayload(payloadJobj.ToObject(of Dictionary(of String, Object))()))
where header is jwtHeader and payloadJobj is jwtpayload.

Error : error BC36754: ‘Dictionary(ofString, Object)’ cannot be converted to IEnumerable(Of Claim)

Can someone please help resolving the error.

Thanks,
Nancy

Got resolved by my own using deserialization.

jwttoken = new JwtSecurityToken(header, new JwtPayload.deserialize(payloadvar))

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.