glassfish 3 - User Authentication and Authorization with grizzly websockets -
I have gone through several tutorials on user authentication and authorization, most of them using form based authentication (j_security_check) And @Rolls has been granted authorization and jdbcRealm
Therefore, if the authorization is to work then I have to send an HTTP request from the client to the server but send the normal website request I need And if I method I am unauthorized to use (based on the @ rollers parameter) I should get an exception.
Any help would be appreciated.
You can use basic proofs. Base64 Encoded with your username: Send it to the authorization field of the password and request header. Then decode and authenticate for every request on the server. If the resource should be available without authentication, then use You can get the fields from the request headers like this: @PermitAll otherwise use
@RolesAllowed ({"role1", "role2"}) .
request.getHeaderValue ("authorization");
Comments
Post a Comment