To configure Shiro, you need to fill in the jwt secret key, so I asked gpt how to write a simple code to generate a key
import secrets
import string
def generate_jwt_secret_key(length):
alphabet = string.ascii_letters + string.digits + "!@#$%^&*()-_=+[]{}|;:,.<>?~"
jwt_secret_key = ''.join(secrets.choice(alphabet) for _ in range(length))
return jwt_secret_key
jwt_secret = generate_jwt_secret_key(32) # Generate a 32-character key
print(jwt_secret)
As for why I have to write a blog post about this, mainly because the child is too inexperienced, doesn't know how to write code or even a blog, so I'm using this opportunity to write an article ^^, to practice
This article is synchronized updated to xLog by Mix Space
The original link is https://www.ssstttar.com/posts/programming/jwt