Control the size of compressed JWTs
A number of AM features accept JWTs to receive information. Some examples are:
Remote consent, when it receives consent responses.
The OAuth 2.0/OpenID Connect authorization service, when:
OpenID Connect clients send request parameters as a JWT instead of as HTTP parameters.
OpenID Connect clients register dynamically using software statements.
The Authentication service, when configured to issue client-side sessions.
The JWTs that AM receives can be signed and/or encrypted. Sometimes, larger JWTs are compressed to improve delivery speeds to AM.
Decompressing a JWT makes it expand in size.
By default, AM rejects any JWT that expands to more than 32 KiB (32768 bytes),
and throws an exception with a message similar to
JWT payload decompressed to larger than maximum allowed size.
Ensure that the JWTs your clients send to AM are smaller than 32 KiB before compression.
Alternatively, increase the 32 KiB value to a reasonable limit. Take into account that AM performs decryption and decompression operations in its heap, and that you do not want to allow very large JWTs to, potentially, leave AM out of memory.
If you need to change the default value, perform the following steps:
org.forgerock.json.jose.jwe.compression.max.decompressed.size.bytesJava system property on the container where AM runs.
For example, edit the
setenv.shfile of the Apache Tomcat instance, and set the property with the new size in bytes:
Restart the container for the changes to make effect.