RE: Open new external URL with hearder

Hi!!!
I dont wnat sent parameters, i want set the header, so http://dddddd.com?Authoritation=DDDDDD no is valid for me :frowning:

I need open a new page…
With my code (up) i get the new page correctly by i dont set the header:
response.setHeader (“Accept-Language”, “de”);
response.setHeader (“Authorization”, “Bearer f453b3c2-36a0-4207-b028-dead0e81c1e8”); // Your test header

By response.setHeader (“Location”, “url”); works (i suppose i need sent the header in resquest not in response)… but doesnt exit something like request.setHeader(“”);

Thanks again
Edu

Hi.
I need to do, from my application to Vaadin a button that when pressed open a new page of an external application (google, amazon, etc.) but passing in the header an authentication token, for example “Authorization”: "Bearer f453b3c2-36a0- 4207-b028-dead0e81c1e8 ".

As much as I searched, I have not found anything.
The closest thing is this code:

   VaadinSession.getCurrent (). AddRequestHandler (
              new RequestHandler () {
            @Override
            public boolean handleRequest (VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException {
                    response.setHeader ("Accept-Language", "de");
                    response.setHeader ("Authorization", "Bearer f453b3c2-36a0-4207-b028-dead0e81c1e8"); // Your test header
                    response.setHeader ("Location", "url"); // //
                    return true;
            }
        });

Although I redirected, does not pass the header …
Any idea how to do it?

Thank you!!!

How are you opening the new page? With BrowserWindowOpener? If so, you might need to create a new client-side extension based on it and use something like what this Stack Overflow question’s answer proposes:
https://stackoverflow.com/questions/23138671/how-to-add-authentication-header-to-window-open

-Olli

Although now that I look at it, BrowserWindowOpener does allow parameters as well, so a custom extension might not be needed. Haven’t ever tried that in practice, though.