c# - JwtSecurityToken exception while decoding Azure Mobile Services JWT token -
the following code:
using system.identitymodel.tokens; jwtsecuritytoken jwtsecuritytoken = new jwtsecuritytoken(rawtoken); generates following exception:
jwt10113: unable decode 'header' value "0" not of type "system.string" , cannot used in generic collection. parameter name: value when 'header' section of rawtoken is:
eyjhbgcioijiuzi1niisinr5cci6ikpxvcisimtpzci6mh0 which can decoded to:
{"alg":"hs256","typ":"jwt","kid":0} the source of faulting token azure mobile services.
please note exception not occur when calling same line of code while 'header' section is:
eyjhbgcioijiuzi1niisinr5cci6ikpxvcisimtpzci6ijaifq which can decoded to:
{"alg":"hs256","typ":"jwt","kid":"0"} how can overcome problem, , validate such token?
this bug in azure mobile services respect conformance jwt spec. bug has since been fixed, jwts generated mobile services should have correct string value in "kid" field of header.
Comments
Post a Comment