public class SecurityAnswer extends Object
Modifier and Type | Field and Description |
---|---|
static String |
REQUIREMENT_PROPERTY_ANSWER
Represents the answer property.
|
static String |
REQUIREMENT_PROPERTY_CUSTOM_QUESTION
Represents the customQuestion property.
|
static String |
REQUIREMENT_PROPERTY_QUESTION_ID
Represents the questionId property.
|
Constructor and Description |
---|
SecurityAnswer()
Constructs a
SecurityAnswer object. |
Modifier and Type | Method and Description |
---|---|
void |
verifyAndHashInput(CryptoService cryptoService,
JsonValue kba,
Map<String,Map<String,String>> kbaQuestions)
Verifies and hashes the input provided for security questions and answers.
|
public static final String REQUIREMENT_PROPERTY_ANSWER
public static final String REQUIREMENT_PROPERTY_CUSTOM_QUESTION
public static final String REQUIREMENT_PROPERTY_QUESTION_ID
public SecurityAnswer()
SecurityAnswer
object.public void verifyAndHashInput(CryptoService cryptoService, JsonValue kba, Map<String,Map<String,String>> kbaQuestions) throws ResourceException
cryptoService
- the cryptoservice used to hash answerskba
- the kba input provided. The input will be in the format of:
[
{
"answer": "foo",
"customQuestion": "what was your first car?"
},
{
"answer": "bar",
"questionId": "1"
},
{
"answer": {
"$crypto": {
"value": {
"algorithm": "SHA-256",
"data": "UWAXzofPG7AZFQBQMORbh1uVBHhHxzaO+B0CucfxXf8TJuX7kVxiH/mZleHdHQp4"
},
"type": "salted-hash"
}
},
"questionId": "2"
}
]kbaQuestions
- the admin defined kba questions. The format of these questions will be:
{
"1": {
"en": "What's your favorite color?",
"en_GB": "What is your favourite colour?",
"fr": "Quelle est votre couleur préférée?"
},
"2": {
"en": "Who was your first employer?"
}
}ResourceException
- thrown if criteria isn't met or answer cannot be hashedCopyright © 2010-2018, ForgeRock All Rights Reserved.