Custom Authentication base on specific headers

Good morning,
I would like to create a custom authenticator that check for a specific header in the request. Is it possibile? If yes, how?

Thanks
Enrico

All IAuthWithRequest per Request Auth Providers generally authenticate based on info in the HTTP Request Headers. You can search the ServiceStack GitHub Repo with its “Go to file” (key t) feature to quickly navigate to their implementation.

Following your suggestion I did something like this

To make it shorter, when I found the correct ApiKey in the headers I switch to the bearer token authentication.

How it sound?

Yeah looks like it could work.