Request to j_security_check return 408 error only with right paramters

后端 未结 1 1942
时光取名叫无心
时光取名叫无心 2020-12-20 09:42

I want to send request to j_security_check from servlet and get auth cookie from response. Code:

String url = \"http://someserver:8080/j_security_check?j_use         


        
相关标签:
1条回答
  • 2020-12-20 10:34

    To get some resource on the tomcat server with j_security_check auth it is necessary to implement three steps:

    1. Send GET request to the needed private resource, in response you get a cookie (Header "Set cookie".
    2. Send request with cookie (from step 1) to the j_security_check. On response you should get code 302 - "Moved Temporarily".
    3. Now you can repeat request to the private resource with same cookie, on responce you get needed resource data.
    0 讨论(0)
提交回复
热议问题