Hello,
I am very new to the picketlink project, I am using 2.7.1.Final on wildfly10. with JSF2 CDI, PrimeFaces etc.
When user invokes the following method from JSF page(Button).
It will show a error message "Authorization check failed" on the JSF page.
How to customize the error message? Thanks.
import org.picketlink.authorization.annotations.RolesAllowed;
@Named
@RequestScoped
public class UserBean {
@RolesAllowed({SYSTEM_ADMIN})
public String callSysAdminMethod() {
return "this is system admin method";
}
}
If you find out what exception is being thrown (check the logs), one of the ways to do is to add this in the configuration, like:
.redirectTo("/faces/error.xhtml").whenException(AuthenticationRequiredException.class)