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

IdentityIQ Plugin - Learn how to write one for your customer

IdentityIQ Plugin - Learn how to write one for your customer

IdentityIQ plugin is a powerful feature which allows to develop a solution for any non-standard IdM use-case and embed within IIQ. Plugin does not require application container restart and can be installed/uninstalled/upgraded/update without needing any downtime.

Plugin Development guides are available in Compass community but the intention of this article is to provide guidance with an easy, known, relatable and end-to-end use-case as example that a beginner can follow. There could be a debate on the integrity of use-case used in this article whether a plugin should be developed for that or not. As stated above, intention is purely to present something that any IIQ developer can understand and relate to and get encouragement to learn plugin development techniques.

The attached PDF explains step by step approach to start writing plugins.  Plugin zip is also attached for reference.

 

Labels (1)
Attachments
Comments

Hi, 

Thanks for the document and the Plugin Zip.

Would you be able to share the Source for the ContractorManagementPlugin.jar.  I would need to get it customized to suite our needs. 

Thanks

Yes, will provide the source shortly
PKS

Hi Kalyan,

Thanks for plugin!

Can you please share the details to display identity's details like extended and named attributes as well?

Hi Kalyan, 

Thanks for the document and the Plugin Zip.

Would you be able to share the Source for the ContractorManagementPlugin.jar. 

Thanks a lot!

Hi @kalyankumar_saha 

I am trying to create a File Upload Plugin using angulatJS and I have tried almost everything...

But when from the Javascript I call the Rest API that I created, I get the error 405 when Rest API is called...

I have presented the snippets from Javascript and my rest api.

Even when I followed the code from Contractor Management Plugin, still no help...

Any hints would be welcome...

Even the ToDo Plugin gives the same error. If I make a call to the Rest API using Postman and authorize as spadmin, still no luck. Same 405 (Method Not allowed Error) occurs.

 

I have tried all ways but no success.

Below is sample of my javascript code

(function () {
'use strict';
var myApp = angular.module('app');
myApp.service('fileUploadService', function ($http, $q) {

this.uploadFileToUrl = function (file, uploadUrl) {
//FormData, object of key/value pair for form fields and values
var fileFormData = new FormData();
fileFormData.append('file', file);

var deffered = $q.defer();
$http.post(uploadUrl, fileFormData, {
transformRequest: angular.identity,

headers: {
"X-XSRF-TOKEN": PluginHelper.getCsrfToken(),
'Content-Type': undefined
}

}).then(function successCallback(response) {
// this callback will be called asynchronously
// when the response is available
console.log("success");


}, function errorCallback(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
console.log("error occurred");

});

return deffered.promise;
}
});
})();

 

My Java Rest API code is

@POST
@Path("upload")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@RequiredRight("FileUploadPluginRight")
//@AllowAll
public Response uploadFile(
@FormDataParam("file") InputStream uploadedInputStream,
@FormDataParam("file") FormDataContentDisposition fileDetail) throws GeneralException {

System.out.println("I am in the method....");
StringBuffer buffer = new StringBuffer();
try {
int read = 0;
byte[] bytes = new byte[1024];

while ((read = uploadedInputStream.read(bytes)) != -1) {
String s = new String(bytes, "US-ASCII");
buffer.append(s);
System.out.println("Data "+s);
}

} catch (IOException e)
{
e.printStackTrace();
}
return Response.status(200).entity(buffer).build();
}

Thanks,
Sunil

 

@rajuskey, We have a requirement to ask users upload some files during contractor onboarding. Will it be possible for you to share the code you used to achieve file upload functionality?

Version history
Revision #:
5 of 5
Last update:
‎Apr 11, 2023 10:31 PM
Updated by: