Hi,
I’m using apache as reverse proxy and use tomcat as backend application server.
I want to get user name that authenticated by apache’s basic authentication in my Vaadin application.
I implemented my Vaadin UI as follow.
@Push
public class MyVaadinUI extends UI
{
@Override
protected void init(VaadinRequest request) {
final VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
setContent(layout);
Label l = new Label("User : " + VaadinService.getCurrentRequest().getRemoteUser());
layout.addComponent(l);
}
And I configured apache and tomcat as follow.
apache
ProxyRequests Off
ProxyPass /myapp/PUSH/ ws://localhost:8080/myapp/PUSH/
ProxyPassReverse /myapp/PUSH/ ws://localhost:8080/myapp/PUSH/
ProxyPass /myapp/ ajp://localhost:8009/myapp/
ProxyPassReverse /myapp/ ajp://localhost:8009/myapp/
<Location "/">
AuthType Basic
AuthName "Auth"
AuthUserFile /etc/httpd/.htpasswd
Require valid-user
</Location>
tomcat
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" tomcatAuthentication="false" />
<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"
connectionTimeout="20000"
redirectPort="8443"
tomcatAuthentication="false" />
When I access http://localhost/myapp/ and enter authentication information, user name I entered is appeared.
But, when I refresh the page by browser refresh button, “User : null” is displayed. The issue is this.
Do you know why I can’t get user name?
When I don’t use “@Push”, this issue does not occur. Is my Push implimentation or configuration wrong?
Best regards,