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 @PermitAll otherwise use @RolesAllowed ({"role1", "role2"}) .

You can get the fields from the request headers like this:

  request.getHeaderValue ("authorization");    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -