How to dynamically choose at runtime which Authenticator to use?


I have an API for which I’d like to support both basic auth and bearer token flows. To this end, I’d like to choose dynamically at runtime which authenticator I should be using based on the Authorization header of the upcoming requests.

Is this possible? And if it is, then what would be the sketch implementation for such solution?

Note: I am completely new to the Scala world, Play framework, and Silhouette :slight_smile: We already have a Bearer token authentication flow in place.

Thanks for your help!