Forward Auth with OAuth2

I'm a bit confused what the purpose of this middleware is.

Looking at the docs for Forward Auth, it doesn't seem like we would need something from a third party.

If I am using my own self-hosted auth server (IdentityServer) then would I need that third party middleware?