-
Notifications
You must be signed in to change notification settings - Fork 13
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
Authorizer Headers are not carried through to Response #34
Comments
Hm, this looks like a (big!) bug in jax-rs-pac4j :) I suppose the problem comes from the fact that I originally assumed that the headers added to the response would be only in case there was a refusal of the request by pac4j (hence the headers set in the My bad, I will try to quickly find a way to reproduce in a unit test and fix it! Thanks for the report :) |
All the properties set by pac4j (e.g., headers from authorizers) were only set on the response in case of failure, but not when the jax-rs runtime was answering. This is fixed, but the `skipResponse` option disables this behaviour. Closes pac4j/dropwizard-pac4j#34
@jmmk this should be fixed on master of jax-rs-pac4j, could you try with it? (simply use the latest stable version of dropwizard-pac4j and 2.0.2-SNAPSHOT of jax-rs-pac4j, there are instructions in the README for the repository to use to get them). If everything is good, then we will quickly release a new version of jax-rs-pac4j and dropwizard-pac4j! |
@victornoel I've tested Thanks for the quick turnaround |
@leleuj could we get a release for jax-rs-pac4j and dropwizard-pac4j? This bug was a big one :) and after I will start migrating to pac4j 3 I think… |
Sure. I will do that this week-end... |
I released jax-rs-pac4j v2.0.2 and dropwizard-pac4j v2.0.1. |
excellent, thanks. @jmmk you can go on with the latest release! Thanks for the report and don't hesitate if you see more problems :) |
@leleuj I'm really sorry, I forgot to push my commits in dropwizard-pac4j where I updated some of the dependencies before asking you to release… could you release dropwizard-pac4j again? It would now be v2.0.2. Sorry again :) |
I updated the jax-rs-pac4j dependency, but not the others in fact. Starting the release... |
I'm done. The artifacts will show up in the Maven central repository. I let you handle the rest... |
I am not sure if this is an issue with
dropwizard-pac4j
orjax-rs-pac4j
, or something I am doing incorrectlyAuthorizers such as
xssprotection
,noframe
,csrf
, andnosniff
work by setting a header on theWebContext
. I have enabled these Authorizers, and I can see them being called and setting the header on theServletJaxRsContext
(I can see this by looking at theabortResponse
). However, I do not see the headers in the server's response.It seems that the headers from
ServletJaxRsContext
are lost and do not actually make it into the response.Example code:
Pac4j Configuration:
Add Resources
AuthResource:
NormalResource:
This is where I would expect to have the headers set in the response, but they are not there.
The text was updated successfully, but these errors were encountered: