Could I change props in a jwt, which I get from an external scheme?
For example, could I set the expiration date or add a custom props into?
In code like this I cannot set something in TokenValidationParameters
and validate this
services
.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options =>
{
options.Authority = "Some external authoriy link"
options.TokenValidationParameters = new TokenValidationParameters
{
...
};
No, you cannot directly change the properties in a JWT token issued by an external provider. JWT tokens are digitally signed by the identity provider to ensure their integrity and prevent tampering. Any modification to the token's payload, including changing claims, would invalidate the signature and render the token invalid.