Question

IFS REST API -- Lobster Middleware

  • 9 October 2023
  • 6 replies
  • 109 views

Hi,

when sending a HTTP Post request to IFS REST API I get an 400 error as respone.

On the IFS Server I see this log message:

2023/10/06 06:31:12 [warn] 96#96: *149147568 [lua] cookie.lua:146: bake(): SameSite value must be 'Strict', 'Lax' or 'None' while connecting to upstream, client: x.x.x.x, server: IFS, request: "POST /main/ifsapplications/projection/v1/LocationHandling.svc/LocationSet HTTP/1.1", host: "IFS"

The Post request is initiated by our Lobster middleware, using postman everything is working fine. When doing a HTTP Get to request data it is working as epected.

Is there some config missing in IFS regarding SameSite cookies or do we have to configure something ob Lobster-side?

Thanks,

best regards,

Nico


6 replies

Userlevel 5
Badge +14

Hi @Nico13 ,

 

Can you share your request? 

Hi,

the request is a simple POST to

https://IFS/main/ifsapplications/projection/v1/LocationHandling.svc/LocationSet

with this body:

{
    "LocationID": "SomeNewID",
    "Name": "LocationName",
    "PickupLocation": false
}

Mime-Type: application/json

No HTTP headers defined.

Userlevel 5
Badge +14

@Nico13 

 

There could be a problem with your authentication. I made an example. You can see below.

 

 

Userlevel 5
Badge +14

@Nico13 

 

I can see with the Get request that I sent with the Post request

 

Hi,

thanks for your reply.

Using Postman the request is working as expected. Authentication is done successfully via OAUTH2. I can do POSTs and GETs, everything is fine.

When I use our middleware Lobster the authentication via OAUTH2 is successful too, but the request is not being handled and throws the exception shown in my first post.

In that exception the cookie.lua script expects a value for “SameSite” but I have now idea how this should be provided. It seems that postman handles this automatically, but our middleware does not.

Userlevel 5
Badge +14

I haven't faced problem with cookies before. Like you said there could be a problem about your middleware. 

Reply