Package org.forgerock.openidconnect
Class OpenIdPrompt
- java.lang.Object
-
- org.forgerock.openidconnect.OpenIdPrompt
-
public class OpenIdPrompt extends Object
Parses and validates the OpenId Connect prompt parameters.- Since:
- 12.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROMPT_CONSENTstatic StringPROMPT_LOGINstatic StringPROMPT_NONEstatic StringPROMPT_SELECT_ACCOUNT
-
Constructor Summary
Constructors Constructor Description OpenIdPrompt(String prompt)Constructs a new OpenIdPrompt instance from the given prompt String.OpenIdPrompt(OAuth2Request request)Constructs a new OpenIdPrompt instance directly from the request object by using the constant defined in OAuth2Constants and calling the existing constructor with the string obtained.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsConsent()Determines if the prompt contains 'consent'.booleancontainsLogin()Determines if the prompt contains 'login'.booleancontainsNone()Determines if the prompt contains 'none'.booleancontainsSelectAccount()Determines if the prompt contains 'select_account'.StringgetOriginalValue()Get to the original value passed in.booleanisValid()Determines whether the prompt parameter is valid.
-
-
-
Field Detail
-
PROMPT_NONE
public static final String PROMPT_NONE
- See Also:
- Constant Field Values
-
PROMPT_LOGIN
public static final String PROMPT_LOGIN
- See Also:
- Constant Field Values
-
PROMPT_CONSENT
public static final String PROMPT_CONSENT
- See Also:
- Constant Field Values
-
PROMPT_SELECT_ACCOUNT
public static final String PROMPT_SELECT_ACCOUNT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OpenIdPrompt
public OpenIdPrompt(String prompt)
Constructs a new OpenIdPrompt instance from the given prompt String.
Parses the prompt string (converted to lowercase) by splitting on the ' ' character.- Parameters:
prompt- The prompt.
-
OpenIdPrompt
public OpenIdPrompt(OAuth2Request request)
Constructs a new OpenIdPrompt instance directly from the request object by using the constant defined in OAuth2Constants and calling the existing constructor with the string obtained.- Parameters:
request- The request object
-
-
Method Detail
-
containsNone
public boolean containsNone()
Determines if the prompt contains 'none'.- Returns:
trueif the prompt includes 'none'.
-
containsLogin
public boolean containsLogin()
Determines if the prompt contains 'login'.- Returns:
trueif the prompt includes 'login'.
-
containsConsent
public boolean containsConsent()
Determines if the prompt contains 'consent'.- Returns:
trueif the prompt includes 'consent'.
-
containsSelectAccount
public boolean containsSelectAccount()
Determines if the prompt contains 'select_account'.- Returns:
trueif the prompt includes 'select_account'.
-
isValid
public boolean isValid()
Determines whether the prompt parameter is valid.- Returns:
falseif the prompt includes 'none' combined with either 'consent' or 'login', or 'select_account'.
-
getOriginalValue
public String getOriginalValue()
Get to the original value passed in. This is in case we took the "invoke the constructor with the http request" route and may not have access to the value used.- Returns:
- the original "prompt" value used to initialise this object
-
-