Skip to content

Instantly share code, notes, and snippets.

@Mohamed-Manil
Mohamed-Manil / CustomAuthenticationManager.java
Created October 28, 2023 19:23 — forked from abhijeetchopra05/CustomAuthenticationManager.java
SpringSecurity Custom AuthenticationManager
package com.personal.banking.config;
import com.personal.banking.domain.Role;
import com.personal.banking.domain.User;
import com.personal.banking.repo.UserRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;