Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Java EE 8 Development with Eclipse. - Third Edition

You're reading from  Java EE 8 Development with Eclipse. - Third Edition

Product type Book
Published in Jun 2018
Publisher
ISBN-13 9781788833776
Pages 596 pages
Edition 3rd Edition
Languages
Toc

Table of Contents (20) Chapters close

Title Page
Copyright and Credits
Dedication
Packt Upsell
1. Introducing JEE and Eclipse 2. Creating a Simple JEE Web Application 3. Source Control Management in Eclipse 4. Creating JEE Database Applications 5. Unit Testing 6. Debugging the JEE Application 7. Creating JEE Applications with EJB 8. Creating Web Applications with Spring MVC 9. Creating Web Services 10. Asynchronous Programming with JMS 11. Java CPU Profiling and Memory Tracking 12. Microservices 13. Deploying JEE Applications in the Cloud 14. Securing JEE Applications 1. Other Books You May Enjoy Index

Modifying a database to save authentication information


In this chapter, we will use a database to authenticate users. Other methods used to store security information include files and LDAP. We will need to update our course_management database with tables to store information about users and groups. Let's create three tables—User, Groups, and User_Group:

Figure 14.1: New tables for authentication

TheUsertable stores the username and password. The Groupstable stores the group names. We will group names directly into roles later. The User_Group table is a joint table, joining the User and Groups tables. One user can be in many groups, and one group can have many users.

To simplify mapping information from the preceding tables when configuring realms in JEE servers, we will create a view, named user_group_view, that makes information from all the preceding tables available in one view. The DDL script for the view is as follows:

CREATE
VIEW `user_group_view` AS
    SELECT
        `user`.`user_name...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}