I have written a servlet Filter in which I am trying to get the value of custom header=samlRequest, From rest client/postman chrome plugin i am getting the value of samlRequest, but using ajax call i have provide samlRequest key and its value but in java i am getting the only key samlRequest in "Access-Control-Request-Headers", how to get value of samlRequest.
$.ajax({
url: "http://indlin500.corp.test.com:31000/test/Portal/index.html",
type: "GET",
headers: { 'samlRequest': 'eJzVWVlz4roSfs6/oJhHJvECBkMRTsk2+2ow68stY8u2wBuWjQ2//srsyUlmJufOramTSjm41f '},
beforeSend: function(xhr){xhr.setRequestHeader('samlRequest', 'eJzVWVlz4roSfs6/oJhHJvECBkMRTsk2+2ow68stY8u2wBuWjQ2//srsyUlmJufOramTSjm41f ');},
success: function() { alert('Success!' + authHeader); }
});
FirewalledRequest[ weblogic.servlet.internal.ServletRequestImpl@4f839843[ OPTIONS /testsOSS/Portal/index.html HTTP/1.1 Connection: keep-alive Access-Control-Request-Method: GET Origin: http://10.19.121.17:7001 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Access-Control-Request-Headers: authorization, samlrequest, x-partnerkey Accept: / DNT: 1 Referer: http://10.19.121.17:7001/authentication-uxf-login-0.0.1-SNAPSHOT/customLoginPage.html Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8 ]]
Using chrome rest client plugin I am getting samlRequest in the header with value i have provided.
FirewalledRequest[ weblogic.servlet.internal.ServletRequestImpl@24d746a[ GET /testOSS/Portal/index.html HTTP/1.1 Connection: keep-alive Cache-Control: no-cache samlRequest: eJzVWVlz4roSfs6/oJhHJvECBkMRTsk2+2ow68stY8u2wBuWjQ2//srsyUlmJufOramTSjm41f User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Postman-Token: ce7765d0-94b5-a1e1-d6ba-2abada3dfdd6 Accept: / DNT: 1 Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8
]]
HttpServletRequest
and you will havegetHeader
methods in it. docs.oracle.com/javaee/7/api/javax/servlet/http/… – neomega