Hands-On Spring Security 5 for Reactive Applications by Tomcy John
Author:Tomcy John
Language: eng
Format: epub
Tags: COM051280 - COMPUTERS / Programming Languages / Java, COM053000 - COMPUTERS / Security / General, COM005000 - COMPUTERS / Enterprise Applications / General
Publisher: Packt Publishing
Published: 2018-07-31T08:59:22+00:00
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.10.v20180503</version>
</plugin>
</plugins>
</build>
We add Spring Framework, Spring Security, JSP/JSTL, and the logging framework (SLF4J and Logback) dependencies. We will be using an embedded jetty server (look at the build section) to run our application.
Setting up LoginModule
LoginModule is responsible for authenticating a user. We will be creating our own LoginModule named JaasLoginModule and then implementing the login method. Being a sample application, our login logic is quite trivial. The LoginModule interface has to be implemented for you to write your own custom login module.
Create a class, JaasLoginModule.java (which implements LoginModule), and implement all the methods. In this class, we will be focusing on two important methods. In the initialize method, we get all the necessary information, such as username/password/subject, that is stored as field variables to be used in our main login method:
// Gather information and then use this in the login method
@Override
public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,
?> sharedState, Map<String, ?> options) {
this.subject = subject;
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(7317)
Supercharging Productivity with Trello by Brittany Joiner(6580)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6413)
Mastering Tableau 2023 - Fourth Edition by Marleen Meier(6339)
Inkscape by Example by István Szép(6197)
Visualize Complex Processes with Microsoft Visio by David J Parker & Šenaj Lelić(5896)
Build Stunning Real-time VFX with Unreal Engine 5 by Hrishikesh Andurlekar(4889)
Design Made Easy with Inkscape by Christopher Rogers(4587)
Customizing Microsoft Teams by Gopi Kondameda(4127)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3932)
Extending Microsoft Power Apps with Power Apps Component Framework by Danish Naglekar(3717)
Business Intelligence Career Master Plan by Eduardo Chavez & Danny Moncada(3671)
Salesforce Platform Enterprise Architecture - Fourth Edition by Andrew Fawcett(3591)
Pandas Cookbook by Theodore Petrou(3573)
The Tableau Workshop by Sumit Gupta Sylvester Pinto Shweta Sankhe-Savale JC Gillet and Kenneth Michael Cherven(3373)
TCP IP by Todd Lammle(2982)
Drawing Shortcuts: Developing Quick Drawing Skills Using Today's Technology by Leggitt Jim(2910)
Applied Predictive Modeling by Max Kuhn & Kjell Johnson(2858)
Work Smarter with Microsoft OneNote by Connie Clark(2842)
