Saturday, November 28, 2015

Sample OAAM 11g API code to reset security profile

Sample Code:

package com.pokuri.oaam;

import java.util.ArrayList;
import java.util.List;

import com.bharosa.vcrypt.auth.intf.*;
import com.bharosa.vcrypt.auth.util.VCryptAuthUtil;
import com.bharosa.vcrypt.common.util.VCryptResponse;
import com.bharosa.vcrypt.customercare.impl.VCryptCCImpl;
import com.bharosa.vcrypt.customercare.impl.VCryptCCSOAPImpl;
import com.bharosa.vcrypt.customercare.util.VCryptCCUtil;

import com.bharosa.vcryptclient.proxy.exception.BharosaProxyException;
import com.bharosa.vcryptclient.proxy.intf.BharosaProxy;

/**
 * @author siva pokuri
 *
 */
public class ChallengeQuestionsReset
{
public static void main(String[] args)
{
ChallengeQuestionsReset cu = new ChallengeQuestionsReset();
String response = "FAILED";
try
{
response = cu.resetUserProfile("spokuri", "Default");
System.out.println("Response " + response);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("RESPONSE " + response);
}
 
  public String resetUserProfile(String userName, String primaryGroupName)
{
   System.out.println("Creating user: " + userName);
            try{
 
   VCryptCCSOAPImpl vcc = new VCryptCCSOAPImpl();
   VCryptResponse vr = vcc.resetUser(userName);
 
   System.out.println("Message " +vr.getSuccess());
   System.out.println("Status code Message " +vr.getResponseCode());

return "SUCCESS";

  }
  catch (Exception e) {
// TODO: handle exception
}
return "FAILED";
}

}

-- Siva Pokuri.

7 comments:

  1. Hi,

    I'm trying out my 1st code wrt OAAM. Don't we need to create session with OAAM to execute this reset operation.

    Thanks,
    Krishna

    ReplyDelete
    Replies
    1. No. As I used OAAM customer Care API's.

      Thanks

      Delete
    2. Thank you Siva for your prompt response.

      Delete
    3. Hi Siva, could you please provide a sample on OAAM Customer Care APIs. Where deploy & how to make calls to that reset functionality provided in this article.

      Please help!

      Thanks,
      Krishna Mohan

      Delete
    4. This comment has been removed by the author.

      Delete
    5. Hi,

      Below links will help you.

      https://docs.oracle.com/cd/E27559_01/apirefs.1112/e27208/toc.htm

      https://docs.oracle.com/cd/E29542_01/admin.1111/e14568/web.htm#AAMAD6041

      Thanks

      Delete