Layer7 Access Management

Expand all | Collapse all

AssertionGeneratorPlugin

Jump to Best Answer
  • 1.  AssertionGeneratorPlugin

    Posted 11-13-2017 04:30 AM

    Hello All,

     

    I am trying to implement a custom assertion generator plugin i.e. Plug in Class. The class seems to be loaded fine, but it's giving me below Value/error in the SMPS.log .

     

    Below is the sample code:-

    public class ClassName
    implements AssertionGeneratorPlugin
    {
    public boolean init(APIContext apiContext)
    throws Exception
    {
    apiContext.error("ClassName initialized.");
    return true;
    }

    public boolean release(APIContext apiContext)
    throws Exception
    {
    apiContext.error("ClassName unloaded.");
    return true;
    }

    public int customizeAssertion(APIContext apiContext, UserContext userContext, String pluginParam, String inputResponse, StringBuffer outputResponse)
    throws Exception
    {
    if ((inputResponse == null) || (inputResponse.equals("")))
    {
    apiContext.log("ClassName: No input assertion received:");
    return -1;
    }

     

    Values/Error in SMPS.Log:- 

    [17260/43][Tue Nov 07 2017 06:25:40][SmAuthUser.cpp:691][ERROR][sm-Server-02740] Classname initialized.
    [17260/43][Tue Nov 07 2017 06:25:40][SmAuthUser.cpp:685][INFO][sm-Server-03580] ClassName: No input assertion received:

     

    This means that the Plugin is loaded fine, hence could see Classname Initialized, but if ((inputResponse == null) || (inputResponse.equals(""))) is getting logged as ClassName: No input assertion received . Which seems that inputResponse is null and it's not receiving any SAML Assertion to edit, But i could see SAML assertion generated fine after authetication and strangely inputResponse is null.

     

    What could be possible reason for that?

     

    Your Help would be appreciated.

     

    Thank You

    Ankur



  • 2.  Re: AssertionGeneratorPlugin

    Posted 11-17-2017 05:22 PM

    Hi Ankur,

     

    Are you able to generate the SAML assertion without the Custom Assertion Generator ? Custom Assertion Generator needs the actual SAML Assertion to make additional changes to it via Custom Assertion Generator.

     

    I am sure you would have done the below but you can double check :

    1. Have you provided the Custom Assertion Generator JAR file path in JVMOptions.txt along with the dependent JARS ?

    2. Have you provided the Custom Assertion Generator JAR for the Plug-in Class in partnership.

     

    Thanks,

    Gopi



  • 3.  Re: AssertionGeneratorPlugin

    Posted 12-03-2017 11:23 PM

    Hello Gopi,

     

    Yes, it's working fine now. Able to get the Assertion plugin working. Yes, have updated JVMOptions.txt and Plug-in class in partnershipt.

     

    Thank you for your response!



  • 4.  Re: AssertionGeneratorPlugin

    Posted 12-03-2017 11:19 PM

    Hi Ankur,

     

    Just checking if you still have this issue ?

     

    Regards,

    Ujwol



  • 5.  Re: AssertionGeneratorPlugin
    Best Answer

    Posted 12-03-2017 11:24 PM

    Hello Ujwol,

     

    Yes, it's working fine now. Able to get the Assertion plugin working. Enhanced logging a bit and could catch the error in parameters passed.

     

    Thanks!