Sample code of OAAM 11g API code to get user challenge questions


import com.bharosa.client.BharosaHelper;
import com.bharosa.client.BharosaSession;
import com.bharosa.client.enums.BharosaEnumAuthStatus;
import com.bharosa.client.enums.BharosaEnumChallengeResult;
import com.bharosa.vcrypt.auth.impl.VCryptAuthSOAPImpl;
import com.bharosa.vcrypt.auth.intf.VCryptAuthResult;
import com.bharosa.vcrypt.auth.intf.VCryptAuthUser;
import com.bharosa.vcrypt.auth.intf.VCryptLocalizedString;
import com.bharosa.vcrypt.auth.intf.VCryptQuestion;
import com.bharosa.vcrypt.common.util.VCryptResponse;
import com.bharosa.vcrypt.tracker.util.CookieSet;
import com.bharosa.vcryptclient.proxy.intf.BharosaProxy;

public class OAAMCQuestions {

/**
* @param args
*/
public static void main(String[] args) {
OAAMCQuestions ocqv =  new OAAMCQuestions();
ocqv.getUserChallengeQuestions();

}
public void getUserChallengeQuestions(){
String username = "spokuri";
try {
            VCryptAuthSOAPImpl auth = new VCryptAuthSOAPImpl();

            VCryptAuthUser user = new VCryptAuthUser();

            BharosaProxy proxy = BharosaProxyImpl.getInstance();
           
            String customerID = proxy.getUserByLoginId(username).getCustomerId();
           
            System.out.println("customerID " + customerID);
           
            user = proxy.getUser(customerID);
           
           
            user = proxy.getUserByLoginId(customerID);
           
            VCryptQuestion secretQuestion = proxy.moveToNextSecretQuestion(customerID);
           
            System.out.println("Secret Question " + secretQuestion);
           
            VCryptQuestion[] secretQuestion1 = proxy.getAllMappedSignOnQuestions(customerID);
           
            String q1 = secretQuestion1[0].toString();
            System.out.println("Question 1" + q1);
            String q2 = secretQuestion1[1].toString();
            System.out.println("Question 2" + q2);
            String q3 = secretQuestion1[2].toString();
            System.out.println("Question 3" + q3);
                       
           
        } catch (Exception e) {
            e.printStackTrace();
        }
       
         
    }



}

Comments

  1. is it possible to execute this code from eclipse or jdeveloper?

    ReplyDelete
  2. could you please share steps for same? We have a requirement

    ReplyDelete
  3. Hi Shiva,
    Could you please let me know how to run the above java code. And where to run the code.

    Thanks in advance,
    Srinivas

    ReplyDelete

Post a Comment