Highlighted
Super Contributor.
Super Contributor.

Re: Update Password via Simple REST Service

Hi,

I had tried the urlPost script, however i am receiving Java Error when trying to connect via HTTPS connectivity.

Message: Code(-9010) An exception occurred: java.lang.IllegalAccessError: tried to access method sun.security.util.ECUtil.getECParameters(Ljava/security/Provider;)Ljava/security/AlgorithmParameters; from class sun.security.ec.ECKeyPairGenerator

Attached is the full Java error.

Anyone have any clue how to resolve this ?

 

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: Update Password via Simple REST Service

Did you import the public certificate from the REST-end-point in to your cacert (/opt/novell/eDirectory/lib64/nds-modules/jre/lib/security/cacert) ?

Otherwise I'm blank (I and ECMAscript does not get along).

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Update Password via Simple REST Service

Which JRE version are you using with the IDM engine?

Have you changed any of the files in /opt/novell/eDirectory/lib64/nds-modules/jre/lib/security/ ?

--
Norbert
0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: Update Password via Simple REST Service

All,

The Java error is gone once I had imported the public certificate from the REST-end-point in to your cacert (/opt/novell/eDirectory/lib64/nds-modules/jre/lib/security/cacert).

Thanks all for the suggestions.

The next step is to construct my data payload in JSON format with the IDV attributes. A quick question is that is there ECMAScript library provided out of the box ?

From web research the JSON stringnify function is part of ECMAScript, so I could just use the function, and not using the one in another community post ?

Is my understanding correct?

Regards,
Keng

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: Update Password via Simple REST Service

I normally create my jsonPayload via set-local-variable, as that is easier than having to convert a nodeset into JSON with some complicated code.

The Result from the end-point is a different matter, and there are a few options there. Have a look at Fernando's stuff: https://github.com/fchierad?tab=repositories which is a good place to start.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Update Password via Simple REST Service

The ECMAScript runtime in the IDM engine nativly supports the JSON object (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON). So you can create a function like:

function getUpdatePasswordFromSSOPayload(cn, password) {
var request = { "username": cn, "password": password} ;
return JSON.stringify(request);
}

Always use the proper utility functions when serializing data structures to strings. Never try to concat your input with some literal strings to do serizalizion. It will fail at some point, e.g. with a " character in your password.

--
Norbert
0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: Update Password via Simple REST Service

All,

Thanks for all the helps over here. Managed to call the REST Service using the urlPost() without having to go through the complicated (for me as Newbie) REST Driver.

Regards,

Keng

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.