I have the following code:
if let user = response.result.value{
do {
let claims: ClaimSet = try JWT.decode(user.access_token, algorithm: .hs256(self.jwtSecret.data(using: .utf8)!))
user.id = claims["sub"] as! Int
user.iss = claims["iss"] as! String
print(claims)
} catch {
print("Failed to decode JWT: \(error)")
reject(error)
}
}
But I have that error. Now when I'm validating on jwt.io I had a valid decodification. There's a picture of that validation:
So i dont understand what am I doing wrong. Any suggestion?
Best Regards
Your secret key isnt in base64.It should be base64.