Hi
Thanks for the answer:

Originally Posted by
rwinch
What does your method signature (including the annotation) look like? Does
Code:
@RequestMapping(value = "{username}/more", method = RequestMethod.GET)
@PreAuthorize("#username == principal.username")
public String doSomething(@PathVariable String username, Model model)

Originally Posted by
rwinch
this also happen when you are authenticated? If so what type of authentication are you doing?
No, only if I am not authenticated.

Originally Posted by
rwinch
My guess is you will need to change to something similar to the following:
Code:
@PreAuthorize("isFullyAuthenticated() and #username == principal.name")
public void doSomething(String username);
Thank you very much, it works, but only if I use instead of (another Doc-Bug?)

Originally Posted by
rwinch
2) It should probably include isAuthenticatedFully() since the AnymousAuthentidcationFilter creates an AnonymousAuthenticationToken with a String for the principal (thus principal.name is String.name which is not valid).
Thanks, that did work, except for that principal.*user*name issue.
Best Regards