can't create token - 'NotImplementedError: Unsupported signing method'
when I run this code,
payload = 'username'
hmac_secret = 'my$ecretK3y'
token = JWT.encode payload, hmac_secret, 'HS256'
I get this error JSON::GeneratorError: only generation of JSON objects or arrays allowed
I am using ruby version 2.3.0 in a rails 4.2.6 project
Your payload needs to be a hash.
payload = {
username: 'username'
}
I changed the payload to
payload = { username: 'username' }
and ran
payload = { username: 'username' }
hmac_secret = 'my$ecretK3y'
JWT.encode(payload, hmac_secret, "H256")
and I get this error
NotImplementedError: Unsupported signing method
@Jpease1020 Were you able to solve this? I am having same issue!
@HimaChitalia
Have you checked for typos? Sometimes I catch myself fast typing H256 instead of HS256 or E512 instead of ES512.
@HimaChitalia
Have you checked for typos? Sometimes I catch myself fast typing
H256instead ofHS256orE512instead ofES512.
Great thanks!