The signing key‘s size is 136 bits which is not secure enough for the HS256 algorithm. The JWT JWA S

news/2025/1/15 12:57:24/

今天在用JWT的时候发现报了这个错误

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Sun Feb 07 15:30:44 CST 2021

There was an unexpected error (type=Internal Server Error, status=500).

The signing key's size is 136 bits which is not secure enough for the HS256 algorithm. The JWT JWA Specification (RFC 7518, Section 3.2) states that keys used with HS256 MUST have a size >= 256 bits (the key size must be greater than or equal to the hash output size). Consider using the io.jsonwebtoken.security.Keys class's 'secretKeyFor(SignatureAlgorithm.HS256)' method to create a key guaranteed to be secure enough for HS256. See https://tools.ietf.org/html/rfc7518#section-3.2 for more information.

 

查了一些资料,发现是因为使用HS256算法需要的秘钥长度为2048

解决方案:

把自己的秘钥加长为2048个字符就好了


http://www.ppmy.cn/news/337876.html

相关文章

k8s pod configmap挂载外部配置文件

1. 创建configmap # nginx-vue-router.conf server {listen 80;listen [::]:80;server_name localhost;#access_log /var/log/nginx/host.access.log main;location / {root /usr/share/nginx/html;index index.html index.htm;# 适配vue-routertry_files $uri $…

k8s zookeeper 问题解决:UnknownHostException: zk-2.zk-hs.default.svc.cluster.local

报错信息: Cannot open channel to 3 at election address UnknownHostException: zk-2.zk-hs.default.svc.cluster.local 解决思路: 配置文件$ ZOOKEEPER_HOME / conf / zoo.cfg,每个机器IP设置为“0.0.0.0”,如下所示&#…

FPGA EMMC HS400模式verilog驱动开发

背景 前期Emmc驱动最高支持到HS200,整体的性能还有待提高,本次考虑将模式升级到HS400模式,理论最快读写速度可达400MB/S HS400特性如下: 1.切换过程 相对之前的设计,考虑增加一个读取设备类型的操作: …

scanf_s 用法

今天,我在使用scanf_s编写C语言程序,因为是在visual stidio 2013 只能使用建立C程序,再将后缀名改成.c来实现。 ANSI中的的scanf(),在读取时不检查边界,可能会造成内存访问越界,例如分配了5字节的空间但是读…

USB HS-PHY眼图调试

1 USB2 PHY AFE 1.1 USB 2.0 FS PHY github ultraembedded / core_usb_fs_phy NOP USB transceiver for all USB transceiver which are either built-in into USB IP or which are mostly autonomous. 1.2 电阻参数 USB host端:D和D-各接一个15kΩ的下拉电阻&#…

解决k8s访问报anonymous cannot get path的问题

k8s图形界面登录报错如下 {"kind": "Status","apiVersion": "v1","metadata": {},"status": "Failure","message": "forbidden: User \"system:anonymous\" cannot get path…

k8s部署kafka集群

前言 环境:centos 7.9 k8s集群、zookeeper集群 本篇将在k8s中部署kafka集群,kafka依赖zookeeper集群,zookeeper集群我们已经搭建好了,可以参考https://blog.csdn.net/MssGuo/article/details/127773132 制作对应版本的kafka镜像…

HS-SR04超声波模块

1.模块简介 HC-SR04超声波模块常用于机器人避障、物体测距、液位检测、公共安防、停车场检测等场所。HC-SR04超声波模块主要是由两个通用的压电陶瓷超声传感器,并加外围信号处理电路构成的。如图: 两个压电陶瓷超声传感器,一个用于发出超声波…