Hi There, I've scheduler task that was developed using java and its been using hard coded corporate AD credentials in it. Now I'd like to initiate REST API call to retrieve password via CCP.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hi There, I've scheduler task that was developed using java and its been using hard coded corporate AD credentials in it. Now I'd like to initiate REST API call to retrieve password via CCP.

L5 Sessionator
 
7 REPLIES 7

L5 Sessionator

 

Java code ready now to call CCP using REST API and get the required password. I'd like to understand the best authentication method for this java code.

L5 Sessionator

Actually in my java code I'm using authorization explicitly, is it a right approach?HttpGet getRequest = new HttpGet(queryURL);

System.out.println("executing request to " + target+getRequest.getURI());

   getRequest.addHeader("Authorization", "Basic ZGVtb2FkLmxvY1xhZG1pbmlzdHJhdG9yOlRyeXN1Y2Nlc3M4MA==");

L3 Networker

One of the key reasons/benefits of using AIM, is to remove hardcode credential. So having a hard coded corporate AD credentials is not the best idea. Is this scheduler executes on a domain machine? If yes, you may consider to use domain authenication; if not, there are other authenications like allow machines or cert that can be used by Java. These are standard authenications so you can find lots of example in the internet.

L4 Transporter

You can refer to the CCP guide.

CCP supports 3 app authentication methods:

 

-Client Certs

-Allowed Machine : IP address

-Windows domain OS User: OS User which is running the app

L4 Transporter

If local cache is one of the consideration, you may want to consider using CP instead.

There is a ready Java library to retrieve credential.

L2 Linker

We're running into a problem where there are *too* many examples on the internet for accessing the windows user default credentials (useDefaultCredentials in Powershell/.NET speak). And many of them no longer work. Has anyone found a straightforward Java example for making a CCP REST call pulling the user's credentials from the authenticated windows context?

If not, and *if* we do find something that works, I'll contribute it here.

L2 Linker

Well, following up on old questions we had.

 

We're starting to move all this to Conjur/DAP. Much more flexible and scalable. :]

 

  • 493 Views
  • 7 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!