Authentication Provider - vignesh01105/UserLoginSystem GitHub Wiki

Default Authentication Add username and password in the application .properties file to authenticate Login form.

Customize Authentication

  1. Provide our own Aunthentication Provider to convert unauthenticate object to Authentication obejct
  2. To provide our own authentication, Need Separate Repository layer to communicate with Database layer.
  3. Configure Database connection in Application. properties file.
  4. In this repo, using DAO Authentication provider calling Database to fetch data.

Screenshot 2025-06-04 084829

Implementation

  1. Add two dependencies like JPA and MySQL in build.gradle file
  2. Add DB configuration in application. properties file.
  3. In Security Configuration Add DAO Authentication provider to give your Own UserServiceDetails
  4. Implement the Own UserServiceDetails by Implementing the loadByUsername predefined method.
  5. To check Username, we have to retrieve the data from DB by calling Repo class.
  6. if the User is not present, then its says User is not found. otherwise return User Object.