> -----Original Message-----
> From: Niki Dokovski [mailto:nick...@gmail.com]
> Sent: Monday, September 09, 2013 1:11 PM
> To: Tomcat Users List
> Subject: Re: how to access HTTP response from jsr-356
> ServerEndpointConfig.Configurator.modifyHandshake?
> 
> On Mon, Sep 9, 2013 at 5:26 PM, Bob DeRemer
> <bob.dere...@thingworx.com>wrote:
> 
> >  Thanks for the direction on using the respective Client/Server
> > EndpointConfig.Configurator plumbing to do a pre-connection AUTH.
> > Unfortunately, I'm stuck on the server side when trying to actually
> > modify the HTTP response result code from within the Configurator.  It
> > doesn't appear that the HandshakeResponse [or anything else that I
> > could see] provides access to modify the actual HTTP response - setting it 
> > to
> 403 if
> > the AUTH fails.    In fact, from looking at the UpgradeUtil.doUpgrade, it
> > seems that the decision to upgrade has already been made by the time
> > the modifyHandshake override gets called.
> >
> Yes the decision is'already made at that point. In this version of the spec 
> and
> current implementation, the only place to actully provide different status 
> code
> (aka 403) is when checkOrigin returns false.
> http://docs.oracle.com/javaee/7/api/javax/websocket/server/ServerEndpointC
> onfig.Configurator.html#checkOrigin(java.lang.String)
> 
> I don't know wether this works in your case, but for sure the next spec 
> revision
> could try to provide more application control in "modifyHandshake"
> 

checkOrigin would work if there was some way to gain access to the client 
supplied headers.  Is there any way for my checkOrigin method to get access to 
the calling request and associated HTTP headers?  If not, then I'm not sure how 
to perform a pre-connected AUTH check based on the current implementation.

if there are any other suggestions, please LMK; meanwhile, I'll keep digging to 
see if there's another solution.

Thx,bob

> cheers
> Niki
> 
> 
> 
> ****
> >
> > ** **
> >
> > If I'm missing anything, please let me know.****
> >
> > ** **
> >
> > Thanks,****
> >
> > ** **
> >
> > *Bob DeRemer*
> >
> > *Senior Director, Architecture and Development*
> >
> > ** **
> >
> > [image: Description: Description: Description: Description:
> > cid:image001.png@01CBE3DE.51A12030]****
> >
> > http://www.thingworx.com****
> >
> > Skype: bob.deremer.thingworx****
> >
> > O: 610.594.6200 x812****
> >
> > M: 717.881.3986****
> >
> > ** **
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to