Layer7 API Management

 View Only
  • 1.  Please explain this error

    Posted Jan 13, 2020 09:50 AM
    2020-01-13T14:48:38.308+0000 WARNING 18827 com.l7tech.server.policy.assertion.ServerSetVariableAssertion: 151: Variable 'siteminder.smcontext.attributes' is not a String and cannot be converted to one. (Actual type: com.ca.siteminder.SiteMinderContext$Attribute)


  • 2.  RE: Please explain this error

    Posted Jan 14, 2020 06:00 AM
    You cannot use the vairable directly you may want to extract something from the attributes e.g. SMSESSIONID or look at the example over here 
    https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/layer7-api-management/api-gateway/9-1/reference/context-variables/ca-single-sign-on-context-variables.html



  • 3.  RE: Please explain this error

    Posted Jan 14, 2020 06:44 AM
    I got this Ronald,

    but what if we may want to extract all the values from siteminder.smcontext.attributes? (as this a multi-valued thing)


  • 4.  RE: Please explain this error

    Posted Jan 14, 2020 06:52 AM
    Edited by Deactivated User Jan 14, 2020 06:52 AM
    Which version of Gateway are you using. if you are using version 9.4 you can actually get the information from mutivalued variable using JavaScript assertion. extract attribute and then traverse for response.
    var multiValues= context.getVariable('request.http.parameters.multiparam'); //Reading multivalued variable
    for(var i in multiValues) {
    // iterating through multi valued variabes.
    }


    https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/layer7-api-management/api-gateway/9-4/policy-assertions/assertion-palette/service-availability-assertions/execute-javascript-assertion.html


  • 5.  RE: Please explain this error

    Posted Jan 14, 2020 07:10 AM
    We are currently using CA API Gateway 9.2.

    can we follow this approach (incomplete) to achieve extracting all the values :
    https://community.broadcom.com/communities/community-home/digestviewer/viewthread?MID=745121 

    But, thanks for letting us know that we can use JavaScript in 9.4


  • 6.  RE: Please explain this error
    Best Answer

    Posted Jan 14, 2020 07:23 AM
    Ok Try this
    This basically join all multivalued variables 
    Then log the variable smcontext this will give you # seperated values
    Can you send me the output. I can provide you feedback from then

    ​​


  • 7.  RE: Please explain this error

    Posted Jan 14, 2020 07:33 AM
    Option 2:
    • When the content is not a string type, it is generally necessary to add the following text to the end of the context variable in the audit assertion: .mainpart
    • Example:
      • When the error shown in the audit viewer is Variable 'attribute.current' is not a String and cannot be converted to one. (Actual type: com.ca.siteminder.SiteMinderContext$Attribute) the audit assertion logging it should be changed from having a context variable named ${siteminder.smcontext.attributes} to a context variable named ${siteminder.smcontext.attributes.mainpart}


    https://ca-broadcom.wolkenservicedesk.com/external/article?articleId=98152


  • 8.  RE: Please explain this error

    Posted Jan 14, 2020 08:15 AM
      |   view attached
    Sorry I cannot try this on my side as I dont have Siteminder setup but going as per the logic this policy assertion should work

    Attachment(s)

    xml
    sm-extract.xml   6 KB 1 version