|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nimbusds.oauth2.sdk.id.Identifier com.nimbusds.openid.connect.sdk.Nonce
@Immutable public final class Nonce
Nonce. This is a random, unique string value to associate a user-session with an ID Token and to mitigate replay attacks. This class is immutable.
Example generation of a nonce with eight random mixed-case alphanumeric characters:
Nonce nonce = new Nonce(8);
Related specifications:
Constructor Summary | |
---|---|
Nonce()
Creates a new nonce with a randomly generated value. |
|
Nonce(int length)
Creates a new nonce with a randomly generated value of the specified length. |
|
Nonce(String value)
Creates a new nonce with the specified value. |
Method Summary | |
---|---|
boolean |
equals(Object object)
Overrides Object.equals() . |
static Nonce |
parse(String s)
Parses a nonce from the specified string. |
Methods inherited from class com.nimbusds.oauth2.sdk.id.Identifier |
---|
getValue, hashCode, toJSONString, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Nonce(String value)
value
- The nonce value. Must not be null
or empty
string.public Nonce(int length)
length
- The number of characters. Must be a positive integer.public Nonce()
Method Detail |
---|
public boolean equals(Object object)
Identifier
Object.equals()
.
equals
in class Identifier
object
- The object to compare to.
true
if the objects have the same value, otherwise
false
.public static Nonce parse(String s)
s
- The string to parse, null
or empty if no nonce is
specified.
null
if the parsed string was
null
or empty.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |