How to write a custom middleware to override admin login API

System Information
  • Strapi Version: 4.24.2
  • Operating System: Windows 11 Pro
  • Database: sqlite
  • Node Version: 20.12.1
  • NPM Version: 10.5.0
  • Yarn Version: NA

We need to authenticate admin using third party API. Looks like passport is used in middleware to authenticate in Strapi V4.

How do I override it by building a custom middleware ?