forked from jbufu/openid4java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNonceVerifier.java
More file actions
53 lines (44 loc) · 1.46 KB
/
NonceVerifier.java
File metadata and controls
53 lines (44 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Copyright 2006-2008 Sxip Identity Corporation
*/
package org.openid4java.consumer;
import com.google.inject.ImplementedBy;
/**
* @author Marius Scurtescu, Johnny Bufu
*/
@ImplementedBy(InMemoryNonceVerifier.class)
public interface NonceVerifier
{
/**
* This noce is valid and it was not seen before. Nonce should be accepted.
*/
public static final int OK = 0;
/**
* The nonce was seen before. Nonce should be rejected.
*/
public static final int SEEN = 1;
/**
* The timestamp of the nonce is invalid, it cannot be parsed. Nonce should be rejected.
*/
public static final int INVALID_TIMESTAMP = 2;
/**
* The timestamp of the nonce is too old and it is not tracked anymore. Nonce should be rejected.
*/
public static final int TOO_OLD = 3;
/**
* Checks if a nonce was seen before. It also checks if the time stamp at the beginning of the noce is valid.
* Also, if old nonces are discarded the it should check if the time stamp for this noce is still valid.
*
* @return {@link #OK} only if this nonce has a valid time stamp, the time stamp did not age and the nonce was not
* seen before.
*/
public int seen(String opUrl, String nonce);
/**
* Returns the expiration timeout for nonces, in seconds.
*/
public int getMaxAge();
/**
* Sets the expiration timeout for nonces, in seconds.
*/
public void setMaxAge(int ageSeconds);
}