Layer7 API Management

  • 1.  Dynamic Cookie

    Posted Dec 19, 2016 11:36 PM

    The Client is passing in a Dynamic cookie (example:- OpenIDConnect.nounce.A1234awds). The Last String is dynamically generated by the client. What is the best way to read this cookie on the API Gateway?



  • 2.  Re: Dynamic Cookie
    Best Answer

    Broadcom Employee
    Posted Dec 20, 2016 04:06 PM

    Hi Venky-Rams

     

    Is "OpenIDConnect.nounce.A1234awds" the cookie name or value that is dynamic? 


    If the VALUE is dynamic you can retrieve this by using the context variable: ${request.http.cookievalues.<name>}

    If the NAME is dynamic you may be able to use some regex along these lines. This will match any 9 characters after the nounce value.

     

    OpenIDConnect.nounce.[a-zA-Z0-9]{9}

     

    Regards,

    Joe



  • 3.  Re: Dynamic Cookie

    Broadcom Employee
    Posted Dec 20, 2016 05:07 PM

    Hi Joe,

    The regex part  is cool.

    But can we get the cookie value using regex in the name? like, ${request.http.cookievalues.OpenIDConnect.nounce.[a-zA-Z0-9]{9}} ?

     

    Thanks,

    Mark



  • 4.  Re: Dynamic Cookie

    Broadcom Employee
    Posted Dec 20, 2016 05:18 PM

    Hi Mark,

     

    I don't think we can do that part (nor can we nest variables). You would need to pull all the cookies, ${request.http.cookies}, and use the regex against this to pull out the specific value for the name.

     

    Regards,

    Joe