Hi Shani,

using axaj will not cause a redirect so this is not what you want.

please try [1], This way you can send POST params in a redirect which are
not visible in browser URL and are protected by HTTPS.
we use this IS for redirect [2]

[1]
http://stackoverflow.com/questions/8389646/send-post-data-on-redirect-with-javascript-jquery
[2]
https://github.com/wso2/carbon-identity/blob/master/components/application-authenticators/org.wso2.carbon.identity.application.authenticator.samlsso/src/main/java/org/wso2/carbon/identity/application/authenticator/samlsso/SAMLSSOAuthenticator.java#L431

On Fri, Oct 16, 2015 at 1:25 PM, Thilini Cooray <[email protected]> wrote:

> Hi,
>
> An example for setting custom headers using xmlHttp.setRequestHeader is
> mentioned in [1].
> Please have a look whether it can be useful.
>
> [1]
> http://forums.asp.net/t/2027077.aspx?Set+requestHeader+in+javascript+and+fetch+its+value+in+controller+
>
> Thanks.
>
> On Fri, Oct 16, 2015 at 12:29 PM, Thusitha Thilina Dayaratne <
> [email protected]> wrote:
>
>> Hi Shani,
>>
>> AFAIU When you use location.href for the redirection it makes a http
>> request. There we can't add custom headers[1].
>> But according to the post you can use cookies. Hope it might help you.
>>
>> [1] -
>> http://stackoverflow.com/questions/24130004/adding-http-headers-to-window-location-href-in-angular-app
>>
>> Thanks
>>
>> On Fri, Oct 16, 2015 at 12:17 PM, Shani Ranasinghe <[email protected]>
>> wrote:
>>
>>> Hi Lasantha,
>>>
>>> Thank you for the information.
>>>
>>> Actually this is in the JS, not in a Jag. I am using location.href
>>> currently to do the redirection.
>>>
>>> On Fri, Oct 16, 2015 at 12:08 PM, Lasantha Samarakoon <
>>> [email protected]> wrote:
>>>
>>>> Hi Shani,
>>>>
>>>> in Jaggey, the response.sendRedirect() method invokes the
>>>> HttpServletResponse.sendRedirect() method which sends "302 Found" response
>>>> to the browser. Then the browser initiates a new request to the URL which
>>>> is passed via the "Location" HTTP header.
>>>>
>>>> ex:
>>>> HTTP/1.1 302 Found
>>>> Location: http://www.example.com/
>>>>
>>>> Therefore, you won't be able to pass a custom HTTP header along with
>>>> the response.sendRedirect() method.
>>>>
>>>> [1]
>>>> http://stackoverflow.com/questions/17227511/pass-header-parameters-with-sendredirect-url
>>>>
>>>>
>>>> Regards,
>>>>
>>>> *Lasantha Samarakoon* | Software Engineer
>>>> WSO2, Inc.
>>>> #20, Palm Grove, Colombo 03, Sri Lanka
>>>> Mobile: +94 (71) 214 1576
>>>> Email:  [email protected]
>>>> Web:    www.wso2.com
>>>>
>>>> lean . enterprise . middleware
>>>>
>>>> On Fri, Oct 16, 2015 at 10:32 AM, Shani Ranasinghe <[email protected]>
>>>> wrote:
>>>>
>>>>> [+ WSO2 Dev]
>>>>>
>>>>> On Fri, Oct 16, 2015 at 10:12 AM, Shani Ranasinghe <[email protected]>
>>>>> wrote:
>>>>>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have a requirement where I need to do a redirect from a Javascript,
>>>>>> and I need to send some headers along with it too.
>>>>>>
>>>>>> The scenario is as follows.
>>>>>>
>>>>>> From my jaggery layer, I use a JS.At the JS, I receive a callbackURL
>>>>>> & a workflow reference Id, I need to pass this to the external party to
>>>>>> which I would redirect so that they could use those information to
>>>>>> communicate back to the APIM.  It is better if we can send this via 
>>>>>> headers
>>>>>> from the JS (because in HTTPS headers will be secured).
>>>>>>
>>>>>> Cookies, is not a good choice, as browsers can disable them, Forms
>>>>>> put in an additional popup & notifies that the data is transmitted
>>>>>> insecurely, hence forms are not a good option as well.
>>>>>>
>>>>>> Could we use XMLHttpRequest for this? however, we are not expecting a
>>>>>> response.
>>>>>>
>>>>>> Are there any other alternatives?
>>>>>>
>>>>>> Any help is appreciated.
>>>>>>
>>>>>> --
>>>>>> Thanks and Regards
>>>>>> *,Shani Ranasinghe*
>>>>>> Senior Software Engineer
>>>>>> WSO2 Inc.; http://wso2.com
>>>>>> lean.enterprise.middleware
>>>>>>
>>>>>> mobile: +94 77 2273555
>>>>>> Blog: http://waysandmeans.blogspot.com/
>>>>>> linked in: lk.linkedin.com/pub/shani-ranasinghe/34/111/ab
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Thanks and Regards
>>>>> *,Shani Ranasinghe*
>>>>> Senior Software Engineer
>>>>> WSO2 Inc.; http://wso2.com
>>>>> lean.enterprise.middleware
>>>>>
>>>>> mobile: +94 77 2273555
>>>>> Blog: http://waysandmeans.blogspot.com/
>>>>> linked in: lk.linkedin.com/pub/shani-ranasinghe/34/111/ab
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Thanks and Regards
>>> *,Shani Ranasinghe*
>>> Senior Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: +94 77 2273555
>>> Blog: http://waysandmeans.blogspot.com/
>>> linked in: lk.linkedin.com/pub/shani-ranasinghe/34/111/ab
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Thusitha Dayaratne
>> Software Engineer
>> WSO2 Inc. - lean . enterprise . middleware |  wso2.com
>>
>> Mobile  +94712756809
>> Blog      alokayasoya.blogspot.com
>> About    http://about.me/thusithathilina
>>
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Best Regards,
>
> *Thilini Cooray*
> Software Engineer
> Mobile : +94 (0) 774 570 112 <%2B94%20%280%29%20773%20451194>
> E-mail : [email protected]
>
> WSO2 Inc. www.wso2.com
> lean.enterprise.middleware
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
With regards,
*Manu*ranga Perera.

phone : 071 7 70 20 50
mail : [email protected]
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to