SwitchFilter forwarding condition

This topic has 1 reply, 1 voice, and was last updated 1 week, 6 days ago by vanamali.

  • Author
    Posts
  • #28519
     vanamali
    Participant

    Hello Folks,

    I have a weird issue going with IG (7.x) where I am trying to trap a 400 response code. Send it to a staticresponse handler with a custom message. The switchfilter is doing its job, but the call to the handler is sent as a request. So, any headers to be tracked as part of the forwarding is not showing up.

    {
    “name”: “myswitch”,
    “type”: “SwitchFilter”,
    “config”: {
    “onResponse”: [{
    “condition”: “${response.status.code == 400}”,
    “handler”: “customResponseHandler”
    }]
    }
    }

    HTTP/1.1 400 xxxx



    attributes:

    ^[[34m^[[0;39m[I/O dispatcher 67] ^[[34mINFO ^[[0;39m ^[[1;37mo.f.o.d.c.C.c.customResponseHandler^[[0;39m @***Route** –

    — (request) id:a9d52995-cd6e-44b6-9164-b1b7edb17c36-588 —>

    Not sure what’s going on? the switchfilter does not contain an entry for request condition.
    Given the state in which the forwarding happeing is for a onresponse condition, why response headers are not available. If I try for “${response.headers[‘xxxx’][0]} returns null. same for “${request.headers[‘xxx’][0]} returns value.

    Any dependencies that I am missing.

    • This topic was modified 1 week, 6 days ago by vanamali.
    #28520
     vanamali
    Participant

    here’s the 400 related filter

    {
    “name”: “myswitch”,
    “type”: “SwitchFilter”,
    “config”: {
    “onResponse”: [{
    “condition”: “${response.status.code == 400}”,
    “handler”: “customResponseHandler”
    }]
    }
    }

    • This reply was modified 1 week, 6 days ago by vanamali.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

©2021 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?