Class PasswordResetCallback
- java.lang.Object
-
- org.wildfly.security.auth.callback.PasswordResetCallback
-
- All Implemented Interfaces:
Serializable
,Callback
,ExtendedCallback
public final class PasswordResetCallback extends Object implements ExtendedCallback, Serializable
A callback used when a password reset is required. Interactive callback handlers should have the user enter the password two times, comparing them for equality.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private char[]
password
private String
prompt
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description PasswordResetCallback(String prompt)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearPassword()
Clear the stored password bytes by setting them to' '
.char[]
getPassword()
Get the new password.String
getPrompt()
Get the password reset prompt.boolean
isOptional()
Determine if this callback is optional.boolean
needsInformation()
Determine if this callback is requesting information.void
setPassword(char[] password)
Set the new password.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
prompt
private final String prompt
-
password
private char[] password
-
-
Constructor Detail
-
PasswordResetCallback
public PasswordResetCallback(String prompt)
Construct a new instance.- Parameters:
prompt
- the password reset prompt (must not benull
or empty)
-
-
Method Detail
-
getPrompt
public String getPrompt()
Get the password reset prompt.- Returns:
- the password reset prompt
-
getPassword
public char[] getPassword()
Get the new password.- Returns:
- the new password, or
null
if it was not set
-
setPassword
public void setPassword(char[] password)
Set the new password.- Parameters:
password
- the new password
-
clearPassword
public void clearPassword()
Clear the stored password bytes by setting them to' '
.
-
isOptional
public boolean isOptional()
Description copied from interface:ExtendedCallback
Determine if this callback is optional.- Specified by:
isOptional
in interfaceExtendedCallback
- Returns:
true
if the callback is optional,false
if it is mandatory
-
needsInformation
public boolean needsInformation()
Description copied from interface:ExtendedCallback
Determine if this callback is requesting information.- Specified by:
needsInformation
in interfaceExtendedCallback
- Returns:
true
if the callback is requesting information,false
if it is only providing information
-
-