public class SignedToken extends Object
SignedTokenEmailTokenVerifier
uses this class to verify tokens appearing in the custom
xsrfKey
JSON request property. The tokens protect against cross-site request forgery by depending
upon the browser's security model. The classic browser security model prohibits a script from
site A from reading any data received from site B. By sending unforgeable tokens from the server
and asking the client to return them to us, the client script must have had read access to the
token at some point and is therefore also from our server.
Constructor and Description |
---|
SignedToken(int age,
String keyBase64)
Create a new utility, using the specific key.
|
Modifier and Type | Method and Description |
---|---|
static String |
generateRandomKey()
Generate a random key for use with the XSRF library.
|
public SignedToken(int age, String keyBase64) throws XsrfException
age
- the number of seconds a token may remain valid.keyBase64
- base 64 encoded representation of the key.XsrfException
- the JVM doesn't support the necessary algorithms.public static String generateRandomKey()