差異處
這裏顯示兩個版本的差異處。
java:web:restapi:x-http-method-override_filter [2016/02/26 18:07] tony |
java:web:restapi:x-http-method-override_filter [2023/06/25 09:48] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== Incorrect response(401) when using X-HTTP-Method-Override ====== | ||
- | ===== Problem ===== | ||
- | 我們使用Spring的Rest,先前為了支援X-HTTP-Method-Override,在已存在的Filter做了此功能。某天,同事發現使用apache client api操作我們的API發生了401錯誤。而要發生這個問題有兩個條件, | ||
- | - 使用Digest認證 | ||
- | - 使用X-HTTP-Method-Override | ||
- | 因此在我有空時,就開始追蹤這問題。 | ||
- | ===== Trace ===== | ||
- | Sprint Security提供了DigestAuthentationFilter負責處理Digest認證。在使用者發出第一次請求後,Spring Security在察覺未經過驗證的情況下,會透過AuthenticationEntryPoint送出請求認證資訊。 | ||