R
R
Rob1nson2017-04-19 23:55:23
Java
Rob1nson, 2017-04-19 23:55:23

How to properly authorize a user on servlet + jsp?

Hello.
How to correctly implement user authorization with division into roles (for example, admin \ user) in servlet + jsp?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Kolman, 2017-04-20
@Evgeny_13

1. Write a servlet that will check the identity of userName and password, for example from the database, and write the role.
2. Write a filter that will receive the role of an authorized user and prohibit the transition to any pages, to do any actions.
3. Make a jsp page that will use a servlet and send data!
PS Don't forget to register the servlet and filter in web.xml.
1. b18b5f93b4eb4a0e988cd1e1190c139b.png
2. a9a8d900d25348edbb04a6670f7dfbd2.png
3.2207cda414044a729399b22bef125fe1.png

E
Eugene Khrustalev, 2017-04-20
@eugenehr

1. Authorization by container means - JAAS
2. Spring - Spring Security
3. Spring Security + Active Directory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question