IIQ Images Plugin

Forums:

There is a reason why I created the SailPoint forum but have yet to submit anything. This was entirely due to my lack of experience and hopefully will change shortly. Over the last few months I have been working with plugins. The plugin class offered gives you a good start on the foundation but is far from complete. My first experiment was to add the ability to add images to our identity pages. This does not include the image handler itself but uses an API call to an existing URL to retrieve the user image. There is an existing plugin for handling this available on the SailPoint community so I decided to start there. The problem with this is that the source code for the plugin is not available so it would not be acceptable for a production environment. It was however helpful on determining how to recreate the entire process using straight javascript. From what I could determine, the plugin side was pretty much only handling the config for the pre/post string building. As the page is loaded, the page locations where an image should exist are replaced with something similar to <img src='server/images/%user%.png'> and element class info. This meant that all I had to do was to hardcode that url and end it with a />. The one thing I did not like on the plugin is that is using a timer to update the images. I would prefer to build the string concats as they are created, but oh well it appears to work. I had to put some handlers and limits in the javascript just to make sure that there was no runaway loops to crash the page or overload the api. I will add more shortly on how this was accomplished but out of the scope and time for today's topic. To leverage the downloaded plugin, I simply opened it in Eclipse (neon was the suggested release). On opening I determined that there a few class files under the source directory. These are the controllers which handle the loading of the configuration text strings from what I could determine. Since I would hardcode the config strings they would not be required. There should be no need for references to internal api calls if everything is hard coded. I realize that this is not optimal because it does not allow you to change the strings by simply clicking on the config under the plugin administration, but it does however allow me to eliminate the source code which I am unable to inspect for problems. That being said, the only real "in use" pieces of the original plugin are the css files, the manifest and the .js javascript files. The manifest allows you to determine which pages the scripts will function on using regex. When one of those pages loads, the methods will look for the key element that contains the string being passed to the image api url using what I believe is angular searching. I am not proficient and angular or jquery so it may be one or the other. (I am still learning all of that stuff because I simply never used it in my apps). On finding the element that contains the "ID string" it simply replaces %user% in the url path string above. It does however require that the %user% element is somewhere on the page or else it has not way to determine %user%. That is basically it. You can download the plugin from SailPoint community plugins and play with it yourself. Next plugin project: Creating a page where you can search for snapshots, identity archives, certification archives, workitem archives and more.