Spring Security Overview

I’m wondering how should I implement the getAuthentication(req) which seems to be a key part of the mentioned filter which is certainly missing from the post.