Added nonce support to code flow (see #521)