- java.lang.Object
-
- org.glassfish.soteria.mechanisms.openid.OpenIdState
-
- All Implemented Interfaces:
Serializable
public class OpenIdState extends Object implements Serializable
Class to hold state of OpenIdThis is used in the authentication mechanism to both help prevent CSRF and to pass data to the callback page.
- Author:
- Gaurav Gupta, jonathan, Rudy De Busscher
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OpenIdState()Creates a new instance with a random UUID as the state.OpenIdState(String state)Creates a new instance set the state to what is in the constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)static Optional<OpenIdState>from(String state)Factory method which creates anOpenIdStateif the state provided is not NULL or empty.StringgetValue()Gets the stateinthashCode()StringtoString()
-
-
-
Constructor Detail
-
OpenIdState
public OpenIdState()
Creates a new instance with a random UUID as the state.
-
OpenIdState
public OpenIdState(String state)
Creates a new instance set the state to what is in the constructor.This can be used so that the callback page knows the originating page, but is not used by the
OpenIdAuthenticationMechanismby default- Parameters:
state- the state to encapsulate
-
-
Method Detail
-
from
public static Optional<OpenIdState> from(String state)
Factory method which creates anOpenIdStateif the state provided is not NULL or empty.- Parameters:
state- the state to create anOpenIdStatefrom- Returns:
- an
OpenIdStateif the state provided is not NULL or empty
-
getValue
public String getValue()
Gets the state- Returns:
- the state
-
-