Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shiro + Tomcat 8 websocket (JSR356) #2014

Closed
ericvandever opened this issue Jul 6, 2015 · 1 comment
Closed

Shiro + Tomcat 8 websocket (JSR356) #2014

ericvandever opened this issue Jul 6, 2015 · 1 comment

Comments

@ericvandever
Copy link

ShiroInterceptor added attribute FrameworkConfig.SECURITY_SUBJECT is not available from WebSocketHandler when using Tomcat8 and JSR356 API.

Version info:
Atmosphere is using async support: org.atmosphere.container.JSR356AsyncSupport running under container: Apache Tomcat/8.0.23 using javax.servlet/3.0 and jsr356/WebSocket API
atmosphere.cpr.AtmosphereFramework - Atmosphere Framework 2.3.3 started.

The websocket is successfully created/opened and I'm able to send messages back and forth with a client. The issue seems to be that the JSR356 AtmosphereRequest is created with the default destroyable value of true, instead of the set to false (or the value of the Application config parameter) as in Jetty9 or Tomcat7 in the corresponding WebSocketUtils

            boolean isDestroyable = false;
                s = config.getInitParameter(ApplicationConfig.RECYCLE_ATMOSPHERE_REQUEST_RESPONSE); 
                if (s != null && Boolean.valueOf(s)) {
                    isDestroyable = true;
                }

Because destroyable is true, the destroy call at the bottom of AtmosphereFramework doCometSupport removes the localAttributes, including ShiroInterceptor's SECURITY_SUBJECT from the request before it is passed to my custom handler.

jfarcand added a commit that referenced this issue Jul 6, 2015
jfarcand added a commit that referenced this issue Jul 6, 2015
jfarcand added a commit that referenced this issue Jul 6, 2015
@jfarcand jfarcand added the 2.2.8 label Jul 6, 2015
@jfarcand
Copy link
Member

jfarcand commented Jul 6, 2015

@ericvandever Good catch. Fixed in 2.2.8-SNAPSHOT/2.3.4-SNAPSHOT/2.4.0-SNAPSHOT

@jfarcand jfarcand closed this as completed Jul 6, 2015
jfarcand added a commit that referenced this issue Aug 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants