I am implementing a link generation system in my application where a unique link is generated for each user upon signing up. This link is used to identify the user and fetch necessary claims from the backend API. To achieve this, I am using JWT (JSON Web Tokens) to store the necessary claims and validate the user’s identity.
The JWT tokens are generated with a maximum expiration period of 25 years, which is the maximum limit supported by .NET for validating token expiration periods. The tokens are stored in a database table (business_urls
) along with the corresponding URL codes. However, I am still concerned about the security and feasibility of this approach.
Is this approach secure? Are there any potential vulnerabilities or security risks associated with using JWTs with a maximum expiration period of 25 years?
Also, is JWT the right approach for this use case? Are there any alternative token approaches that are equally secure and more suitable for this specific use case?
Are there any best practices or additional measures I can take to further secure the link generation system and prevent potential attacks?