OIM API To Set Challenge Questions For Logged In User


  1. package com.oimacademy.password;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. import java.util.Set;
  5. import oracle.iam.passwordmgmt.api.ChallengeResponseService;
  6. import oracle.iam.passwordmgmt.exception.ChallengeResponseException;
  7. import oracle.iam.passwordmgmt.vo.Challenge;
  8. import com.oimacademy.connection.Platform;
  9. public class SetChallengeQuestionsForLoggedInUser {
  10.  public static void main(String[] args) throws ChallengeResponseException {
  11.    System.out.println("Setting  Challenge Questions ....");
  12.          Map<String, Object> mapQnA = new HashMap<String, Object>();   
  13.    mapQnA.put("What is your mother's maiden name?", "name");
  14.    //mapQnA.put("What is your favorite color?", "5");
  15.    mapQnA.put("What is the city of your birth?", "birth");
  16.    mapQnA.put("What is the name of your pet?", "pet");
  17.     Platform.getService(ChallengeResponseService.class).setChallengeResponsesForLoggedInUser((Set<Challenge>) mapQnA);
  18.  }
  19. }

No comments:

Post a Comment