Access request query parameters from Freemaker login template

I would like to change the content of the login page (Freemaker template) according to the redirect_uri query parameter.

I try to perform this simple Freemaker call:

${request.getParameter(‘redirect_uri‘)}

however, I get the following error in Keycloak log:

Error executing FreeMarker template: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: ==> request […]

Is there anyway to access the query parameters from the FreeMaker template ?

Thanks in advance