-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
@Valid on object parameter implementing Principal without @Auth #1197
Comments
For some reason Jersey is trying to use AuthValueFactoryProvider for injecting of the User instance into the method even when no authentication is used. Looks like a bug. Do you use @Auth annotation on another method or on class level for this resource class? |
No @Auth annotations in that class. |
I've located the bug and will provide fix for this. |
StanSvec
added a commit
to StanSvec/dropwizard
that referenced
this issue
Aug 30, 2015
carlo-rtr
added a commit
that referenced
this issue
Sep 2, 2015
…hen_annotated Fix for #1197 - Principal instance not injected when annotated
Closed by #1241 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using Dropwizard 0.9.0-rc3 and I'm running into some trouble with the new auth system.
I have a User model that implements Principal and a POST resource method for signing up new users. The signup method has a validated User parameter but it's not authenticated. When I try access that resource, I get an IllegalStateException with the message:
Cannot inject a custom principal into unauthenticated request
. Is there an easy way to handle this scenario?EDIT: I should note that it works just fine if I don't use
@Valid
.My signup method looks like this:
The text was updated successfully, but these errors were encountered: