Mariusz_Bo

HTTP 400 Error during Kerberos Authentication

Discussion created by Mariusz_Bo on Jan 27, 2020
Latest reply on Jan 28, 2020 by Mariusz_Bo

Hi,

 

when I try to connect to piwebapi to consume streams via WebSockets I receive HTTP 400 Bad Request:

Request DefaultFullHttpRequest(decodeResult: success, version: HTTP/1.1, content: EmptyByteBufBE)
GET /piwebapi/streamsets/channel?webId=id1&webId=id2

HTTP/1.1
upgrade: websocket
connection: upgrade
sec-websocket-key: ....
sec-websocket-version: 13
origin: host
host: host
accept: */*
user-agent: AHC/2.1
authorization: Negotiate YIIH+...

 

Response DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 400 Bad Request
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8
Server: Microsoft-HTTPAPI/2.0
Access-Control-Allow-Origin: host
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: Allow,Content-Encoding,Content-Length,Date,Location
cache-control: no-cache
WWW-Authenticate: .....
Date: Mon, 27 Jan 2020 23:02:29 GMT

but when I use this same credential and URL and in the first step connect to piwebapi via simple javascript client and then run again my code I receive correct HTTP 101 code

Request DefaultFullHttpRequest(decodeResult: success, version: HTTP/1.1, content: EmptyByteBufBE)
GET /piwebapi/streamsets/channel?webId=id1&webId=id2

HTTP/1.1
upgrade: websocket
connection: upgrade
sec-websocket-key: ...
sec-websocket-version: 13
origin: host
host: host
accept: */*
user-agent: AHC/2.1
authorization: Negotiate YIIH+.....

 

Response DefaultHttpResponse(decodeResult: success, version: HTTP/1.1)
HTTP/1.1 101 No Content
Upgrade: websocket
Server: Microsoft-HTTPAPI/2.0
cache-control: no-cache
Connection: Upgrade
Sec-WebSocket-Accept: .....
WWW-Authenticate: ......
Date: Mon, 27 Jan 2020 23:00:06 GMT

 

#

I also figure out that in first case Kerberos TGT is not created but in second (connection initialized by javascript) I see TGT (klist command)

I use AsyncHttpClient version 2.6.0

 

Any advice?

Outcomes