Interface IImageUrlTokenGenerator
Refreshes the HMAC signature on a generated image URL using the secret key that is currently configured on the imaging middleware.
Namespace: Umbraco.Cms.Core.Media
Assembly: Umbraco.Core.dll
Syntax
public interface IImageUrlTokenGenerator
Remarks
Rich text editors persist image URLs (with the HMAC token baked in) into stored markup. When the secret key is rotated, the persisted token no longer validates and the image fails to render. Render-time pipelines call RefreshSignature(string) to strip any stale token from the URL and re-sign with the current key.
Methods
View SourceRefreshSignature(string)
Strips any existing HMAC token from url and returns the URL
signed with the currently configured secret key. If no key is configured, or
the input is empty, the URL is returned unchanged.
Declaration
string RefreshSignature(string url)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The image URL, optionally containing a stale HMAC token in its query string. |
Returns
| Type | Description |
|---|---|
| string | The image URL with a freshly computed HMAC token (or unchanged if no key is configured). |