Plugin - Review headers information

Team - We have developed a plugin API and having use case to read the additional headers information to perform additional validation. Do we have a way to review the headers in plugin API resource class ?

1 Like

Assuming your plugin extends the sailpoint.rest.plugin.BasePluginResource class, you should be able to grab the raw HttpServletRequest (javax.servlet.http.HttpServletRequest) via the getRequest() method that the BasePluginResource inherits. That should give you all you need to pull request headers: HttpServletRequest (Java(TM) EE 8 Specification APIs)

1 Like

Hello Brian,

Thank you for your response. I able to get the getRequest method from BaseResource class. After I add javax.servlet.http.HttpServletRequest class in Plugin resource I see plugin build failing with following error. Do we need to add javax.servlet.http.HttpServletRequest jar into plugin lib folder ?. I tried to added as well but still getting same error.

error: package javax.servlet.http does not exist

Yes, you may have to manually include that JAR in your plugins lib folder if you’re building/compiling the plugin from source. Most of the runtime-level javax.servlet API libraries are typically packaged with the application server (e.g. Tomcat) in the application server native libraries (tomcat/lib/servlet-api.jar for Tomcat 9), so you shouldn’t need that library actually packaged in the plugin itself.

Thank you @brian_weigel

1 Like