{
String clientToken = token.getClientUid();
String viewId = context.getViewRoot().getViewId();
if (clientToken == null)
{
throw new UnauthorizedCommandException(viewId, "No client identifier provided");
}
String requestedViewSig = context.getExternalContext().getRequestParameterMap().get(FORM_SIGNATURE_PARAM);
if (requestedViewSig == null)
{
throw new UnauthorizedCommandException(viewId, "No form signature provided");
}
if (!requestedViewSig.equals(generateViewSignature(context, form, !token.isAllowMultiplePosts(), token.isRequireSession(), clientToken)))
{
throw new UnauthorizedCommandException(viewId, "Form signature invalid");
}
RenderStampStore store = RenderStampStore.instance();
if (store != null)
{
// remove the key from the store if we are using it