By Modit Parmar
This is an authenticator that uses Java Web Tokens (JWTs) to secure our application and protect endpoints.
We will be using PostgreSQL database in this project to create a user table and store the credentials. For setting up the database in your local system, create a database and edit "security/src/resources/application.yml" file.
-> User registration and authentication
-> Secured communication
-> Token-based authentication
-> Token validation
-> Supports multi-factor authentication.
1. JAVA should be installed.
2. Servers should be install on your PC (eg. apache).
3. PostgreSQL.
4. Postman should be installed.
How to use this packet:
1. Install PostgreSQL server and connect it with your local packet, update details in application.yml file. (snapshot attached below)
2. Run application.java file in your IDE, the user table should be created in your database after running the program.
3. Open postman and use HTTP get request. (http://localhost:8080/api/vi/demo-controller)
4. Once you send get request we see the 403 forbidden status, this means our authenticator is working fine and not allowing access.
5. As we send a getter request for demo controller, we will do the same for authenticate and register.
6. Now we get access only when the entered username and password will be correct as registered.
The purpose of this packet is to provide authentication to your application and can be directly used in your project.
Submitted by Modit Parmar (Modit01)
Download packets of source code on Coders Packet
Comments